diff mbox

[6/8] TDLS: ignore incoming setup-response retries

Message ID 1449744969-14895-6-git-send-email-ilan.peer@intel.com
State Accepted
Headers show

Commit Message

Peer, Ilan Dec. 10, 2015, 10:56 a.m. UTC
From: Arik Nemtsov <arik@wizery.com>

The setup-response timer is relatively fast (500ms) and there are instances
where it fires on the responder side after the initiator has already sent
out the setup-confirm packet. Prevent the processing of this stale
setup-response packet on the initiator side.

Signed-off-by: Arik Nemtsov <arikx.nemtsov@intel.com>
---
 src/rsn_supp/tdls.c | 8 ++++++++
 1 file changed, 8 insertions(+)

Comments

Jouni Malinen Dec. 18, 2015, 8:33 p.m. UTC | #1
On Thu, Dec 10, 2015 at 12:56:07PM +0200, Ilan Peer wrote:
> The setup-response timer is relatively fast (500ms) and there are instances
> where it fires on the responder side after the initiator has already sent
> out the setup-confirm packet. Prevent the processing of this stale
> setup-response packet on the initiator side.

Thanks, applied.
diff mbox

Patch

diff --git a/src/rsn_supp/tdls.c b/src/rsn_supp/tdls.c
index 48752d7..cb85899 100644
--- a/src/rsn_supp/tdls.c
+++ b/src/rsn_supp/tdls.c
@@ -2176,6 +2176,14 @@  static int wpa_tdls_process_tpk_m2(struct wpa_sm *sm, const u8 *src_addr,
 			   "ignore TPK M2 from " MACSTR, MAC2STR(src_addr));
 		return -1;
 	}
+
+	if (peer->tpk_success) {
+		wpa_printf(MSG_INFO, "TDLS: ignore incoming TPK M2 retry, from "
+			   MACSTR " as TPK M3 was already sent",
+			   MAC2STR(src_addr));
+		return 0;
+	}
+
 	wpa_tdls_tpk_retry_timeout_cancel(sm, peer, WLAN_TDLS_SETUP_REQUEST);
 
 	if (len < 3 + 2 + 1) {