From: Benjamin Berg Date: Mon, 20 Nov 2023 23:51:40 +0000 (+0200) Subject: MLD: Use MLD MAC address for deauthentication X-Git-Tag: hostap_2_11~754 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b9c81e2005c5f0a690d9b97ca9dd655b41fca124;p=thirdparty%2Fhostap.git MLD: Use MLD MAC address for deauthentication When connecting, pending_bssid is set to the main link that we are authenticating/associating on. Later on, the MLD MAC address will be stored in the bssid, but we may also try to deauthenticate before we are connected and in that case, pending_bssid is not yet set to the MLD MAC address. As such, use the ap_mld_addr instead of pending_bssid if n_mld_links is non-zero. This is the sensible thing to do and expected behavior on nl80211. Signed-off-by: Benjamin Berg Signed-off-by: Andrei Otcheretianski --- diff --git a/wpa_supplicant/sme.c b/wpa_supplicant/sme.c index c6d725808..d5a4785ea 100644 --- a/wpa_supplicant/sme.c +++ b/wpa_supplicant/sme.c @@ -2667,10 +2667,16 @@ int sme_update_ft_ies(struct wpa_supplicant *wpa_s, const u8 *md, static void sme_deauth(struct wpa_supplicant *wpa_s, const u8 **link_bssids) { int bssid_changed; + const u8 *bssid; bssid_changed = !is_zero_ether_addr(wpa_s->bssid); - if (wpa_drv_deauthenticate(wpa_s, wpa_s->pending_bssid, + if (wpa_s->valid_links) + bssid = wpa_s->ap_mld_addr; + else + bssid = wpa_s->pending_bssid; + + if (wpa_drv_deauthenticate(wpa_s, bssid, WLAN_REASON_DEAUTH_LEAVING) < 0) { wpa_msg(wpa_s, MSG_INFO, "SME: Deauth request to the driver " "failed"); @@ -2706,8 +2712,14 @@ void sme_event_assoc_reject(struct wpa_supplicant *wpa_s, if (wpa_s->current_bss) { struct wpa_bss *bss = wpa_s->current_bss; struct wpa_ssid *ssid = wpa_s->current_ssid; + const u8 *bssid; + + if (wpa_s->valid_links) + bssid = wpa_s->ap_mld_addr; + else + bssid = wpa_s->pending_bssid; - wpa_drv_deauthenticate(wpa_s, wpa_s->pending_bssid, + wpa_drv_deauthenticate(wpa_s, bssid, WLAN_REASON_DEAUTH_LEAVING); wpas_connect_work_done(wpa_s); wpa_supplicant_mark_disassoc(wpa_s);