From: Muna Sinada Date: Tue, 27 Jul 2021 23:42:25 +0000 (-0700) Subject: RNR: Allow Probe Response frame for a colocated 6 GHz AP X-Git-Tag: hostap_2_10~65 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=15f099ec703b2035e487dff374ef3e2ba345a2ea;p=thirdparty%2Fhostap.git RNR: Allow Probe Response frame for a colocated 6 GHz AP When a Probe Request frame from a station includes an SSID matching that of a co-located 6 GHz AP, AP should respond with a Probe Response frame that includes Reduced Neighbor Report element containing information regarding the requested BSS. Signed-off-by: Muna Sinada Signed-off-by: Aloka Dixit --- diff --git a/src/ap/beacon.c b/src/ap/beacon.c index eeb675aa4..22782f54e 100644 --- a/src/ap/beacon.c +++ b/src/ap/beacon.c @@ -644,7 +644,8 @@ static u8 * hostapd_gen_probe_resp(struct hostapd_data *hapd, enum ssid_match_result { NO_SSID_MATCH, EXACT_SSID_MATCH, - WILDCARD_SSID_MATCH + WILDCARD_SSID_MATCH, + CO_LOCATED_SSID_MATCH, }; static enum ssid_match_result ssid_match(struct hostapd_data *hapd, @@ -655,7 +656,9 @@ static enum ssid_match_result ssid_match(struct hostapd_data *hapd, size_t short_ssid_list_len) { const u8 *pos, *end; + struct hostapd_iface *iface = hapd->iface; int wildcard = 0; + size_t i, j; if (ssid_len == 0) wildcard = 1; @@ -689,7 +692,33 @@ static enum ssid_match_result ssid_match(struct hostapd_data *hapd, } } - return wildcard ? WILDCARD_SSID_MATCH : NO_SSID_MATCH; + if (wildcard) + return WILDCARD_SSID_MATCH; + + if (!iface->interfaces || iface->interfaces->count <= 1 || + is_6ghz_op_class(hapd->iconf->op_class)) + return NO_SSID_MATCH; + + for (i = 0; i < iface->interfaces->count; i++) { + struct hostapd_iface *colocated; + + colocated = iface->interfaces->iface[i]; + + if (colocated == iface || + !is_6ghz_op_class(colocated->conf->op_class)) + continue; + + for (j = 0; j < colocated->num_bss; j++) { + struct hostapd_bss_config *conf; + + conf = colocated->bss[j]->conf; + if (ssid_len == conf->ssid.ssid_len && + os_memcmp(ssid, conf->ssid.ssid, ssid_len) == 0) + return CO_LOCATED_SSID_MATCH; + } + } + + return NO_SSID_MATCH; }