]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
RNR: Allow Probe Response frame for a colocated 6 GHz AP
authorMuna Sinada <msinada@codeaurora.org>
Tue, 27 Jul 2021 23:42:25 +0000 (16:42 -0700)
committerJouni Malinen <j@w1.fi>
Tue, 9 Nov 2021 15:55:45 +0000 (17:55 +0200)
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 <msinada@codeaurora.org>
Signed-off-by: Aloka Dixit <alokad@codeaurora.org>
src/ap/beacon.c

index eeb675aa456f0917ae8984c3adc669b33f84ef1a..22782f54e48005ead7e51740c0e08b273e5d9b00 100644 (file)
@@ -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;
 }