From: Jouni Malinen Date: Fri, 2 Dec 2016 10:51:16 +0000 (+0200) Subject: Fix 4addr reassociation-without-deauthentication on AP X-Git-Tag: hostap_2_7~2090 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cb2b666670141d962abbdce3c7e8c7a894f67e07;p=thirdparty%2Fhostap.git 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 --- 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