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>
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 */
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(¶ms, 0, sizeof(params));
wpa_s->reassociate = 0;
wpa_s->eap_expected_failure = 0;