diff options
| author | Sunil Dutt <c_duttus@qti.qualcomm.com> | 2013-08-01 16:36:10 +0530 |
|---|---|---|
| committer | Sunil Dutt <duttus@codeaurora.org> | 2013-08-01 16:39:43 +0530 |
| commit | 96f031f98aa15ac097d745e68572e58467c32d39 (patch) | |
| tree | 46e617daca3f8ece3a0acd334606ec9701cf9a3e | |
| parent | 82410e1c09169133166d255d6a94233a054a0802 (diff) | |
| download | android_external_wpa_supplicant_8-96f031f98aa15ac097d745e68572e58467c32d39.tar.gz android_external_wpa_supplicant_8-96f031f98aa15ac097d745e68572e58467c32d39.tar.bz2 android_external_wpa_supplicant_8-96f031f98aa15ac097d745e68572e58467c32d39.zip | |
TDLS: Handle transmission failures of TPK Handshake messages
A transmission failure of the TDLS Setup Request frame (TPK Handshake
M1) results in no further retries and the peer entry being left in state
where all TDLS Setup Request frames from the peer with higher address
would be rejected, thus always resulting in a failure to establish a
TDLS link. Handle the failures in transmission by disabling the link
immediately to ensure the traffic to the peer goes through the AP. This
commit also handles similar transmision failures for TPK Handshake M2
and M3 frames (TDLS Setup Response and Confirm).
Git-commit: f7b4ef220845f700a19149a96e0fad54d905e123
Git-repo : git://w1.fi/srv/git/hostap.git
Change-Id: I265b1dfc62b26a6e8ef51e1d395e9d793c5cb299
CRs-fixed: 497448
| -rw-r--r-- | src/rsn_supp/tdls.c | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/src/rsn_supp/tdls.c b/src/rsn_supp/tdls.c index 6c411f7a..477463cb 100644 --- a/src/rsn_supp/tdls.c +++ b/src/rsn_supp/tdls.c @@ -935,6 +935,7 @@ static int wpa_tdls_send_tpk_m1(struct wpa_sm *sm, u8 *rbuf, *pos, *count_pos; u16 count; struct rsn_ie_hdr *hdr; + int status; if (!wpa_tdls_get_privacy(sm)) { wpa_printf(MSG_DEBUG, "TDLS: No security used on the link"); @@ -1095,11 +1096,11 @@ skip_ies: "Handshake Message 1 (peer " MACSTR ")", MAC2STR(peer->addr)); - wpa_tdls_tpk_send(sm, peer->addr, WLAN_TDLS_SETUP_REQUEST, 1, 0, - rbuf, pos - rbuf); + status = wpa_tdls_tpk_send(sm, peer->addr, WLAN_TDLS_SETUP_REQUEST, + 1, 0, rbuf, pos - rbuf); os_free(rbuf); - return 0; + return status; } @@ -1113,6 +1114,7 @@ static int wpa_tdls_send_tpk_m2(struct wpa_sm *sm, u32 lifetime; struct wpa_tdls_timeoutie timeoutie; struct wpa_tdls_ftie *ftie; + int status; buf_len = 0; if (wpa_tdls_get_privacy(sm)) { @@ -1178,11 +1180,11 @@ static int wpa_tdls_send_tpk_m2(struct wpa_sm *sm, (u8 *) &timeoutie, (u8 *) ftie, ftie->mic); skip_ies: - wpa_tdls_tpk_send(sm, src_addr, WLAN_TDLS_SETUP_RESPONSE, dtoken, 0, - rbuf, pos - rbuf); + status = wpa_tdls_tpk_send(sm, src_addr, WLAN_TDLS_SETUP_RESPONSE, + dtoken, 0, rbuf, pos - rbuf); os_free(rbuf); - return 0; + return status; } @@ -1196,6 +1198,7 @@ static int wpa_tdls_send_tpk_m3(struct wpa_sm *sm, struct wpa_tdls_ftie *ftie; struct wpa_tdls_timeoutie timeoutie; u32 lifetime; + int status; buf_len = 0; if (wpa_tdls_get_privacy(sm)) { @@ -1259,11 +1262,11 @@ static int wpa_tdls_send_tpk_m3(struct wpa_sm *sm, (u8 *) &timeoutie, (u8 *) ftie, ftie->mic); skip_ies: - wpa_tdls_tpk_send(sm, src_addr, WLAN_TDLS_SETUP_CONFIRM, dtoken, 0, - rbuf, pos - rbuf); + status = wpa_tdls_tpk_send(sm, src_addr, WLAN_TDLS_SETUP_CONFIRM, + dtoken, 0, rbuf, pos - rbuf); os_free(rbuf); - return 0; + return status; } @@ -2016,8 +2019,10 @@ skip_rsn: wpa_printf(MSG_DEBUG, "TDLS: Sending TDLS Setup Confirm / " "TPK Handshake Message 3"); - wpa_tdls_send_tpk_m3(sm, src_addr, dtoken, lnkid, peer); - + if (wpa_tdls_send_tpk_m3(sm, src_addr, dtoken, lnkid, peer) < 0) { + wpa_tdls_disable_link(sm, peer->addr); + return -1; + } wpa_tdls_enable_link(sm, peer); return 0; @@ -2025,8 +2030,7 @@ skip_rsn: error: wpa_tdls_send_error(sm, src_addr, WLAN_TDLS_SETUP_CONFIRM, dtoken, status); - if (sm->tdls_external_setup) - wpa_sm_tdls_oper(sm, TDLS_DISABLE_LINK, src_addr); + wpa_tdls_disable_link(sm, peer->addr); return -1; } |
