From cb2b666670141d962abbdce3c7e8c7a894f67e07 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Fri, 2 Dec 2016 12:51:16 +0200 Subject: [PATCH] Fix 4addr reassociation-without-deauthentication on AP Data connection was lost if a station reassociated without the STA entry being cleaned up on the AP side. Fix this by moving reconfiguration of the STA WDS parameters in association response callback to happen only after the STA flags have been updated to associated stated. Signed-off-by: Jouni Malinen --- src/ap/ieee802_11.c | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c index 3e65fd3b7..1cecc8060 100644 --- a/src/ap/ieee802_11.c +++ b/src/ap/ieee802_11.c @@ -3232,16 +3232,6 @@ static void handle_assoc_cb(struct hostapd_data *hapd, sta->sa_query_timed_out = 0; #endif /* CONFIG_IEEE80211W */ - if (sta->flags & WLAN_STA_WDS) { - int ret; - char ifname_wds[IFNAMSIZ + 1]; - - ret = hostapd_set_wds_sta(hapd, ifname_wds, sta->addr, - sta->aid, 1); - if (!ret) - hostapd_set_wds_encryption(hapd, sta, ifname_wds); - } - if (sta->eapol_sm == NULL) { /* * This STA does not use RADIUS server for EAP authentication, @@ -3258,6 +3248,19 @@ static void handle_assoc_cb(struct hostapd_data *hapd, hostapd_set_sta_flags(hapd, sta); + if (sta->flags & WLAN_STA_WDS) { + int ret; + char ifname_wds[IFNAMSIZ + 1]; + + wpa_printf(MSG_DEBUG, "Reenable 4-address WDS mode for STA " + MACSTR " (aid %u)", + MAC2STR(sta->addr), sta->aid); + ret = hostapd_set_wds_sta(hapd, ifname_wds, sta->addr, + sta->aid, 1); + if (!ret) + hostapd_set_wds_encryption(hapd, sta, ifname_wds); + } + if (sta->auth_alg == WLAN_AUTH_FT) wpa_auth_sm_event(sta->wpa_sm, WPA_ASSOC_FT); else