MLD STA: Use AP MLD address as previous BSSID for reassociation requests

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>
This commit is contained in:
Veerendranath Jakkam 2023-05-05 16:47:42 +05:30 committed by Jouni Malinen
parent 199b44213c
commit df2f22faf9
2 changed files with 17 additions and 2 deletions

View file

@ -3674,7 +3674,13 @@ static void wpa_supplicant_event_assoc(struct wpa_supplicant *wpa_s,
wpas_fst_update_mb_assoc(wpa_s, data); wpas_fst_update_mb_assoc(wpa_s, data);
#ifdef CONFIG_SME #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.prev_bssid_set = 1;
wpa_s->sme.last_unprot_disconnect.sec = 0; wpa_s->sme.last_unprot_disconnect.sec = 0;
#endif /* CONFIG_SME */ #endif /* CONFIG_SME */

View file

@ -3972,7 +3972,16 @@ static void wpas_start_assoc_cb(struct wpa_radio_work *work, int deinit)
return; 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)); os_memset(&params, 0, sizeof(params));
wpa_s->reassociate = 0; wpa_s->reassociate = 0;
wpa_s->eap_expected_failure = 0; wpa_s->eap_expected_failure = 0;