AP: Support Short SSID List element in Probe Request frames

According to IEEE P802.11ax/D6.0, 11.1.4.3.4 (Criteria for sending a
response), AP should answer Probe Request frames if either SSID or Short
SSID matches. Implement this part of the Short SSID use for the BSS (the
collocated 6 GHz BSS case is not covered in this commit).

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
This commit is contained in:
Andrei Otcheretianski 2019-06-19 15:49:16 +03:00 committed by Jouni Malinen
parent 522450b7b1
commit 1c7f652f9e
4 changed files with 36 additions and 16 deletions

View file

@ -581,7 +581,9 @@ enum ssid_match_result {
static enum ssid_match_result ssid_match(struct hostapd_data *hapd, static enum ssid_match_result ssid_match(struct hostapd_data *hapd,
const u8 *ssid, size_t ssid_len, const u8 *ssid, size_t ssid_len,
const u8 *ssid_list, const u8 *ssid_list,
size_t ssid_list_len) size_t ssid_list_len,
const u8 *short_ssid_list,
size_t short_ssid_list_len)
{ {
const u8 *pos, *end; const u8 *pos, *end;
int wildcard = 0; int wildcard = 0;
@ -592,20 +594,30 @@ static enum ssid_match_result ssid_match(struct hostapd_data *hapd,
os_memcmp(ssid, hapd->conf->ssid.ssid, ssid_len) == 0) os_memcmp(ssid, hapd->conf->ssid.ssid, ssid_len) == 0)
return EXACT_SSID_MATCH; return EXACT_SSID_MATCH;
if (ssid_list == NULL) if (ssid_list) {
return wildcard ? WILDCARD_SSID_MATCH : NO_SSID_MATCH; pos = ssid_list;
end = ssid_list + ssid_list_len;
while (end - pos >= 2) {
if (2 + pos[1] > end - pos)
break;
if (pos[1] == 0)
wildcard = 1;
if (pos[1] == hapd->conf->ssid.ssid_len &&
os_memcmp(pos + 2, hapd->conf->ssid.ssid,
pos[1]) == 0)
return EXACT_SSID_MATCH;
pos += 2 + pos[1];
}
}
pos = ssid_list; if (short_ssid_list) {
end = ssid_list + ssid_list_len; pos = short_ssid_list;
while (end - pos >= 2) { end = short_ssid_list + short_ssid_list_len;
if (2 + pos[1] > end - pos) while (end - pos >= 4) {
break; if (hapd->conf->ssid.short_ssid == WPA_GET_LE32(pos))
if (pos[1] == 0) return EXACT_SSID_MATCH;
wildcard = 1; pos += 4;
if (pos[1] == hapd->conf->ssid.ssid_len && }
os_memcmp(pos + 2, hapd->conf->ssid.ssid, pos[1]) == 0)
return EXACT_SSID_MATCH;
pos += 2 + pos[1];
} }
return wildcard ? WILDCARD_SSID_MATCH : NO_SSID_MATCH; return wildcard ? WILDCARD_SSID_MATCH : NO_SSID_MATCH;
@ -838,7 +850,7 @@ void handle_probe_req(struct hostapd_data *hapd,
#endif /* CONFIG_P2P */ #endif /* CONFIG_P2P */
if (hapd->conf->ignore_broadcast_ssid && elems.ssid_len == 0 && if (hapd->conf->ignore_broadcast_ssid && elems.ssid_len == 0 &&
elems.ssid_list_len == 0) { elems.ssid_list_len == 0 && elems.short_ssid_list_len == 0) {
wpa_printf(MSG_MSGDUMP, "Probe Request from " MACSTR " for " wpa_printf(MSG_MSGDUMP, "Probe Request from " MACSTR " for "
"broadcast SSID ignored", MAC2STR(mgmt->sa)); "broadcast SSID ignored", MAC2STR(mgmt->sa));
return; return;
@ -870,7 +882,8 @@ void handle_probe_req(struct hostapd_data *hapd,
#endif /* CONFIG_TAXONOMY */ #endif /* CONFIG_TAXONOMY */
res = ssid_match(hapd, elems.ssid, elems.ssid_len, res = ssid_match(hapd, elems.ssid, elems.ssid_len,
elems.ssid_list, elems.ssid_list_len); elems.ssid_list, elems.ssid_list_len,
elems.short_ssid_list, elems.short_ssid_list_len);
if (res == NO_SSID_MATCH) { if (res == NO_SSID_MATCH) {
if (!(mgmt->da[0] & 0x01)) { if (!(mgmt->da[0] & 0x01)) {
wpa_printf(MSG_MSGDUMP, "Probe Request from " MACSTR wpa_printf(MSG_MSGDUMP, "Probe Request from " MACSTR

View file

@ -282,6 +282,10 @@ static int ieee802_11_parse_extension(const u8 *pos, size_t elen,
elems->oci = pos; elems->oci = pos;
elems->oci_len = elen; elems->oci_len = elen;
break; break;
case WLAN_EID_EXT_SHORT_SSID_LIST:
elems->short_ssid_list = pos;
elems->short_ssid_list_len = elen;
break;
default: default:
if (show_errors) { if (show_errors) {
wpa_printf(MSG_MSGDUMP, wpa_printf(MSG_MSGDUMP,

View file

@ -96,6 +96,7 @@ struct ieee802_11_elems {
const u8 *multi_ap; const u8 *multi_ap;
const u8 *he_capabilities; const u8 *he_capabilities;
const u8 *he_operation; const u8 *he_operation;
const u8 *short_ssid_list;
u8 ssid_len; u8 ssid_len;
u8 supp_rates_len; u8 supp_rates_len;
@ -147,6 +148,7 @@ struct ieee802_11_elems {
u8 multi_ap_len; u8 multi_ap_len;
u8 he_capabilities_len; u8 he_capabilities_len;
u8 he_operation_len; u8 he_operation_len;
u8 short_ssid_list_len;
struct mb_ies_info mb_ies; struct mb_ies_info mb_ies;
}; };

View file

@ -472,6 +472,7 @@
#define WLAN_EID_EXT_HE_MU_EDCA_PARAMS 38 #define WLAN_EID_EXT_HE_MU_EDCA_PARAMS 38
#define WLAN_EID_EXT_SPATIAL_REUSE 39 #define WLAN_EID_EXT_SPATIAL_REUSE 39
#define WLAN_EID_EXT_OCV_OCI 54 #define WLAN_EID_EXT_OCV_OCI 54
#define WLAN_EID_EXT_SHORT_SSID_LIST 58
#define WLAN_EID_EXT_EDMG_CAPABILITIES 61 #define WLAN_EID_EXT_EDMG_CAPABILITIES 61
#define WLAN_EID_EXT_EDMG_OPERATION 62 #define WLAN_EID_EXT_EDMG_OPERATION 62
#define WLAN_EID_EXT_REJECTED_GROUPS 92 #define WLAN_EID_EXT_REJECTED_GROUPS 92