]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
MLD: Use MLD MAC address for deauthentication
authorBenjamin Berg <benjamin.berg@intel.com>
Mon, 20 Nov 2023 23:51:40 +0000 (01:51 +0200)
committerJouni Malinen <j@w1.fi>
Sat, 25 Nov 2023 19:49:06 +0000 (21:49 +0200)
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 <benjamin.berg@intel.com>
Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
wpa_supplicant/sme.c

index c6d725808f7f98e8bb9ff82f5e66f3e802b5956b..d5a4785eaa7adc5a62445e78c1c4a419da2f1fa7 100644 (file)
@@ -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);