diff options
author | Sunil Dutt <c_duttus@qti.qualcomm.com> | 2013-09-30 17:23:23 +0300 |
---|---|---|
committer | Dmitry Shmidt <dimitrysh@google.com> | 2013-09-30 13:26:40 -0700 |
commit | 38ffd8879e7990491033bf20568212e8c3472b48 (patch) | |
tree | 4b9c36f9ef8b2c6e9d5582f3485ef68c444b0435 | |
parent | 6a9f522e56dae5b1fff00642e27b82e82772dcf7 (diff) | |
download | wpa_supplicant_8-38ffd8879e7990491033bf20568212e8c3472b48.tar.gz |
TDLS: Use helper function for disable link operation
This is called from number of locations and it is more efficient to use
a new helper function instead of wpa_tdls_disable_link() that would do
peer address search from the list of peers.
Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
-rw-r--r-- | src/rsn_supp/tdls.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/rsn_supp/tdls.c b/src/rsn_supp/tdls.c index 5fa687e1..74c83fa9 100644 --- a/src/rsn_supp/tdls.c +++ b/src/rsn_supp/tdls.c @@ -771,6 +771,14 @@ int wpa_tdls_teardown_link(struct wpa_sm *sm, const u8 *addr, u16 reason_code) } +static void wpa_tdls_disable_peer_link(struct wpa_sm *sm, + struct wpa_tdls_peer *peer) +{ + wpa_sm_tdls_oper(sm, TDLS_DISABLE_LINK, peer->addr); + wpa_tdls_peer_free(sm, peer); +} + + void wpa_tdls_disable_link(struct wpa_sm *sm, const u8 *addr) { struct wpa_tdls_peer *peer; @@ -780,10 +788,8 @@ void wpa_tdls_disable_link(struct wpa_sm *sm, const u8 *addr) break; } - if (peer) { - wpa_sm_tdls_oper(sm, TDLS_DISABLE_LINK, addr); - wpa_tdls_peer_free(sm, peer); - } + if (peer) + wpa_tdls_disable_peer_link(sm, peer); } @@ -856,11 +862,7 @@ skip_ftie: * Request the driver to disable the direct link and clear associated * keys. */ - wpa_sm_tdls_oper(sm, TDLS_DISABLE_LINK, src_addr); - - /* clear the Peerkey statemachine */ - wpa_tdls_peer_free(sm, peer); - + wpa_tdls_disable_peer_link(sm, peer); return 0; } @@ -2019,9 +2021,7 @@ static int wpa_tdls_process_tpk_m2(struct wpa_sm *sm, const u8 *src_addr, (u8 *) timeoutie, ftie) < 0) { /* Discard the frame */ wpa_tdls_del_key(sm, peer); - wpa_tdls_peer_free(sm, peer); - if (sm->tdls_external_setup) - wpa_sm_tdls_oper(sm, TDLS_DISABLE_LINK, src_addr); + wpa_tdls_disable_peer_link(sm, peer); return -1; } |