]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
MLD: Use BSS Parameters in TBTT Info to check SSID match
authorBen Greear <greearb@candelatech.com>
Sat, 28 Oct 2023 23:24:35 +0000 (16:24 -0700)
committerJouni Malinen <j@w1.fi>
Tue, 7 Nov 2023 17:42:29 +0000 (19:42 +0200)
Use the Same SSID and Colocated AP bits as an alternative way of finding
a match on the current SSID.

Signed-off-by: Ben Greear <greearb@candelatech.com>
wpa_supplicant/sme.c

index e6888f5671c534539d7916991bd12c1a47a3d902..5faa03869091e02f954f1f591fec4561eeaf31be 100644 (file)
@@ -382,6 +382,7 @@ static void wpas_process_tbtt_info(struct wpa_supplicant *wpa_s, const u8 *data)
 {
        struct wpa_bss *neigh_bss;
        const u8 *bssid;
+       u8 bss_params;
        u8 link_id;
 
        /* TBTT Information field
@@ -398,12 +399,14 @@ static void wpas_process_tbtt_info(struct wpa_supplicant *wpa_s, const u8 *data)
         *   B21: Disabled Link Indication */
 
        bssid = data + 1;
+       bss_params = data[1 + ETH_ALEN + 4];
 
        data += 13; /* MLD Parameters */
        link_id = *(data + 1) & 0xF;
 
-       wpa_printf(MSG_DEBUG, "MLD: mld ID=%u, link ID=%u",
-                  *data, link_id);
+       wpa_dbg(wpa_s, MSG_DEBUG,
+               "MLD: mld ID=%u, link ID=%u, bssid=" MACSTR ", bss_params=0x%x",
+               *data, link_id, MAC2STR(bssid), bss_params);
 
        if (*data) {
                wpa_printf(MSG_DEBUG, "MLD: Reported link not part of MLD");
@@ -416,7 +419,9 @@ static void wpas_process_tbtt_info(struct wpa_supplicant *wpa_s, const u8 *data)
                return;
        }
 
-       if (!wpa_scan_res_match(wpa_s, 0, neigh_bss, wpa_s->current_ssid,
+       if (!((bss_params & RNR_BSS_PARAM_SAME_SSID) &&
+             (bss_params & RNR_BSS_PARAM_CO_LOCATED)) &&
+           !wpa_scan_res_match(wpa_s, 0, neigh_bss, wpa_s->current_ssid,
                                1, 0)) {
                wpa_printf(MSG_DEBUG,
                           "MLD: Neighbor doesn't match current SSID - skip link");