aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSunil Dutt <usdutt@qti.qualcomm.com>2013-11-25 16:47:24 +0530
committerSteve Kondik <shade@chemlab.org>2014-06-12 14:07:28 -0700
commit2ca99822cbbee1e9d26ec0dfd46b1630e84eec8b (patch)
treeed51660483c853c51fd3e17bec8363b0aa43cd12
parent6cd0b77e1e4f19d0ff916069b85f4bf191304933 (diff)
downloadandroid_external_wpa_supplicant_8-2ca99822cbbee1e9d26ec0dfd46b1630e84eec8b.tar.gz
android_external_wpa_supplicant_8-2ca99822cbbee1e9d26ec0dfd46b1630e84eec8b.tar.bz2
android_external_wpa_supplicant_8-2ca99822cbbee1e9d26ec0dfd46b1630e84eec8b.zip
TDLS: Do not reenable TDLS link on retransmitted setup frame
A reenable of the TDLS link while the host driver is already processing the same (due to the retransmitted M2/M3 frames) might result in a failed TDLS setup handshake due to some host driver's implementation. Thus, issue enable link only when the peer's TDLS status signifies no prior link (tpk_success=0). Git-commit: 179fc5527d503c7e3588c46d7f5c133b4e5d5e3e Git-repo : git://w1.fi/srv/git/hostap.git CRs-fixed: 577966 Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com> Change-Id: Ie3f3375527b2f2c1bd6c75bc3c976388e5356d6e
-rw-r--r--src/rsn_supp/tdls.c42
1 files changed, 29 insertions, 13 deletions
diff --git a/src/rsn_supp/tdls.c b/src/rsn_supp/tdls.c
index e911ad0f..52309442 100644
--- a/src/rsn_supp/tdls.c
+++ b/src/rsn_supp/tdls.c
@@ -1817,7 +1817,7 @@ static int wpa_tdls_process_tpk_m2(struct wpa_sm *sm, const u8 *src_addr,
int ielen;
u16 status;
const u8 *pos;
- int ret;
+ int ret = 0;
wpa_printf(MSG_DEBUG, "TDLS: Received TDLS Setup Response / TPK M2 "
"(Peer " MACSTR ")", MAC2STR(src_addr));
@@ -2034,11 +2034,19 @@ skip_rsn:
return -1;
}
- ret = wpa_tdls_enable_link(sm, peer);
- if (ret < 0) {
- wpa_printf(MSG_DEBUG, "TDLS: Could not enable link");
- wpa_tdls_do_teardown(sm, peer,
- WLAN_REASON_TDLS_TEARDOWN_UNSPECIFIED);
+ if (!peer->tpk_success) {
+ /*
+ * Enable Link only when tpk_success is 0, signifying that this
+ * processing of TPK M2 frame is not because of a retransmission
+ * during TDLS setup handshake.
+ */
+ ret = wpa_tdls_enable_link(sm, peer);
+ if (ret < 0) {
+ wpa_printf(MSG_DEBUG, "TDLS: Could not enable link");
+ wpa_tdls_do_teardown(
+ sm, peer,
+ WLAN_REASON_TDLS_TEARDOWN_UNSPECIFIED);
+ }
}
return ret;
@@ -2062,7 +2070,7 @@ static int wpa_tdls_process_tpk_m3(struct wpa_sm *sm, const u8 *src_addr,
u16 status;
const u8 *pos;
u32 lifetime;
- int ret;
+ int ret = 0;
wpa_printf(MSG_DEBUG, "TDLS: Received TDLS Setup Confirm / TPK M3 "
"(Peer " MACSTR ")", MAC2STR(src_addr));
@@ -2179,11 +2187,19 @@ static int wpa_tdls_process_tpk_m3(struct wpa_sm *sm, const u8 *src_addr,
}
skip_rsn:
- ret = wpa_tdls_enable_link(sm, peer);
- if (ret < 0) {
- wpa_printf(MSG_DEBUG, "TDLS: Could not enable link");
- wpa_tdls_do_teardown(sm, peer,
- WLAN_REASON_TDLS_TEARDOWN_UNSPECIFIED);
+ if (!peer->tpk_success) {
+ /*
+ * Enable Link only when tpk_success is 0, signifying that this
+ * processing of TPK M3 frame is not because of a retransmission
+ * during TDLS setup handshake.
+ */
+ ret = wpa_tdls_enable_link(sm, peer);
+ if (ret < 0) {
+ wpa_printf(MSG_DEBUG, "TDLS: Could not enable link");
+ wpa_tdls_do_teardown(
+ sm, peer,
+ WLAN_REASON_TDLS_TEARDOWN_UNSPECIFIED);
+ }
}
return ret;
error:
@@ -2284,7 +2300,7 @@ void wpa_tdls_remove(struct wpa_sm *sm, const u8 *addr)
* Disable previous link to allow renegotiation to be completed
* on AP path.
*/
- wpa_sm_tdls_oper(sm, TDLS_DISABLE_LINK, peer->addr);
+ wpa_tdls_disable_peer_link(sm, peer);
}
}