TDLS: Disable links during AP deauth in external flow
authorArik Nemtsov <arik@wizery.com>
Thu, 24 Apr 2014 05:45:37 +0000 (08:45 +0300)
committerJouni Malinen <j@w1.fi>
Tue, 29 Apr 2014 15:59:12 +0000 (18:59 +0300)
When de-authenticating from the AP, disable each TDLS link after
sending the teardown packet. Postpone the reset of the peer state
data until after the link disable request.

Signed-off-by: Arik Nemtsov <arikx.nemtsov@intel.com>
src/rsn_supp/tdls.c

index 5ecf96b..d3d0c42 100644 (file)
@@ -762,9 +762,6 @@ skip_ies:
                          reason_code, 0, rbuf, pos - rbuf);
        os_free(rbuf);
 
-       /* clear the Peerkey statemachine */
-       wpa_tdls_peer_free(sm, peer);
-
        return 0;
 }
 
@@ -2592,8 +2589,8 @@ void wpa_tdls_teardown_peers(struct wpa_sm *sm)
                wpa_printf(MSG_DEBUG, "TDLS: Tear down peer " MACSTR,
                           MAC2STR(peer->addr));
                if (sm->tdls_external_setup)
-                       wpa_tdls_send_teardown(sm, peer->addr,
-                                              WLAN_REASON_DEAUTH_LEAVING);
+                       wpa_tdls_do_teardown(sm, peer,
+                                            WLAN_REASON_DEAUTH_LEAVING);
                else
                        wpa_sm_tdls_oper(sm, TDLS_TEARDOWN, peer->addr);