]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
nl80211: Fix AP MLD MAC address on auth retry
authorJohannes Berg <johannes.berg@intel.com>
Tue, 26 Dec 2023 08:29:46 +0000 (10:29 +0200)
committerJouni Malinen <j@w1.fi>
Sat, 13 Jan 2024 20:33:22 +0000 (22:33 +0200)
The AP MLD MAC address is meant to be preserved here, but since it's
reset to zeroes before attempting to authenticate in
nl80211_mark_disconnected(), we can't just point to the AP MLD MAC
address in drv->auth_ap_mld_addr. Fix it by using a copy.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
src/drivers/driver_nl80211.c

index 92b041eb808b5315e10d6a655700ec064b62dc9f..a5dea1db396b3cbdbd11a3f2af3126192cb6894d 100644 (file)
@@ -4090,6 +4090,7 @@ int wpa_driver_nl80211_authenticate_retry(struct wpa_driver_nl80211_data *drv)
 {
        struct wpa_driver_auth_params params;
        struct i802_bss *bss = drv->first_bss;
+       u8 ap_mld_addr[ETH_ALEN];
        int i;
 
        wpa_printf(MSG_DEBUG, "nl80211: Try to authenticate again");
@@ -4115,8 +4116,10 @@ int wpa_driver_nl80211_authenticate_retry(struct wpa_driver_nl80211_data *drv)
        params.auth_data_len = drv->auth_data_len;
        params.mld = drv->auth_mld;
        params.mld_link_id = drv->auth_mld_link_id;
-       if (drv->auth_mld)
-               params.ap_mld_addr = drv->auth_ap_mld_addr;
+       if (drv->auth_mld) {
+               os_memcpy(ap_mld_addr, drv->auth_ap_mld_addr, ETH_ALEN);
+               params.ap_mld_addr = ap_mld_addr;
+       }
 
        for (i = 0; i < 4; i++) {
                if (drv->auth_wep_key_len[i]) {