]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Fix 4addr reassociation-without-deauthentication on AP
authorJouni Malinen <jouni@qca.qualcomm.com>
Fri, 2 Dec 2016 10:51:16 +0000 (12:51 +0200)
committerJouni Malinen <j@w1.fi>
Fri, 2 Dec 2016 10:51:16 +0000 (12:51 +0200)
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 <jouni@qca.qualcomm.com>
src/ap/ieee802_11.c

index 3e65fd3b7263b4fc542e7a247b2f26b0da2043d1..1cecc80606fd2e321faee4884056d88f744e610f 100644 (file)
@@ -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