diff mbox series

nl80211: Fix AP MLD address on auth retry

Message ID 20231226082946.422182-1-andrei.otcheretianski@intel.com
State Accepted
Headers show
Series nl80211: Fix AP MLD address on auth retry | expand

Commit Message

Andrei Otcheretianski Dec. 26, 2023, 8:29 a.m. UTC
From: Johannes Berg <johannes.berg@intel.com>

The AP MLD 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 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 | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

Comments

Jouni Malinen Jan. 13, 2024, 10:26 p.m. UTC | #1
On Tue, Dec 26, 2023 at 10:29:46AM +0200, Andrei Otcheretianski wrote:
> The AP MLD 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 address in drv->auth_ap_mld_addr. Fix it by using a copy.

Thanks, applied.
diff mbox series

Patch

diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
index a3bb2d5251..4673072911 100644
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
@@ -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]) {