]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
MLD STA: Use AP MLD address as previous BSSID for reassociation requests
authorVeerendranath Jakkam <quic_vjakkam@quicinc.com>
Fri, 5 May 2023 11:17:42 +0000 (16:47 +0530)
committerJouni Malinen <j@w1.fi>
Thu, 25 May 2023 15:06:50 +0000 (18:06 +0300)
The Linux kernel expects to use the AP MLD address in
NL80211_ATTR_PREV_BSSID for reassociation requests when the current
association is MLO capable.

Previously, wpa_supplicant was using the BSSID value in
NL80211_ATTR_PREV_BSSID even if the connection is MLO capable. Fix this
by sending the AP MLD address in NL80211_ATTR_PREV_BSSID for
reassociation requests when MLO is used.

Signed-off-by: Veerendranath Jakkam <quic_vjakkam@quicinc.com>
wpa_supplicant/events.c
wpa_supplicant/wpa_supplicant.c

index 896c53841b734c81dddd82bd95b338faea02e516..70d65b6fec372933e60c2b6f434e573f285a3bab 100644 (file)
@@ -3674,7 +3674,13 @@ static void wpa_supplicant_event_assoc(struct wpa_supplicant *wpa_s,
        wpas_fst_update_mb_assoc(wpa_s, data);
 
 #ifdef CONFIG_SME
-       os_memcpy(wpa_s->sme.prev_bssid, bssid, ETH_ALEN);
+       /*
+        * Cache the current AP's BSSID (for non-MLO connection) or MLD address
+        * (for MLO connection) as the previous BSSID for subsequent
+        * reassociation requests handled by SME-in-wpa_supplicant.
+        */
+       os_memcpy(wpa_s->sme.prev_bssid,
+                 wpa_s->valid_links ? wpa_s->ap_mld_addr : bssid, ETH_ALEN);
        wpa_s->sme.prev_bssid_set = 1;
        wpa_s->sme.last_unprot_disconnect.sec = 0;
 #endif /* CONFIG_SME */
index 909a4bcfe48007a185fdabffc0161ba98334c918..e0f3240e87af22f3e378d81d8414e5b0473e84f9 100644 (file)
@@ -3972,7 +3972,16 @@ static void wpas_start_assoc_cb(struct wpa_radio_work *work, int deinit)
                return;
        }
 
-       os_memcpy(prev_bssid, wpa_s->bssid, ETH_ALEN);
+       /*
+        * Set the current AP's BSSID (for non-MLO connection) or MLD address
+        * (for MLO connection) as the previous BSSID for reassociation requests
+        * handled by SME-in-driver. If wpa_supplicant is in disconnected state,
+        * prev_bssid will be zero as both wpa_s->valid_links and wpa_s->bssid
+        * will be zero.
+        */
+       os_memcpy(prev_bssid,
+                 wpa_s->valid_links ? wpa_s->ap_mld_addr : wpa_s->bssid,
+                 ETH_ALEN);
        os_memset(&params, 0, sizeof(params));
        wpa_s->reassociate = 0;
        wpa_s->eap_expected_failure = 0;