[PATCH 26/42] MLD: Use MLD address for deauthentication

Andrei Otcheretianski andrei.otcheretianski at intel.com
Mon Nov 20 15:51:40 PST 2023


From: Benjamin Berg <benjamin.berg at intel.com>

When connecting, pending_bssid is set to the main link that we are
authenticating/associating on. Later on, the MLD address will be stored
in the bssid, but we may also try to DEAUTH before we are connected and
then pending_bssid is not yet set to the MLD 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 behaviour on
nl80211.

Signed-off-by: Benjamin Berg <benjamin.berg at intel.com>
Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski at intel.com>
---
 wpa_supplicant/sme.c | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/wpa_supplicant/sme.c b/wpa_supplicant/sme.c
index 4d75c0a676..5240490019 100644
--- a/wpa_supplicant/sme.c
+++ b/wpa_supplicant/sme.c
@@ -2668,10 +2668,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;
+	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");
@@ -2707,8 +2713,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;
+			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);
-- 
2.38.1




More information about the Hostap mailing list