From 15f099ec703b2035e487dff374ef3e2ba345a2ea Mon Sep 17 00:00:00 2001 From: Muna Sinada Date: Tue, 27 Jul 2021 16:42:25 -0700 Subject: [PATCH] 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 --- src/ap/beacon.c | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) 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; }