[PATCH 4/7] TDLS: don't fail when failing to process IEs for TPK M3

Ilan Peer ilan.peer
Tue Jun 10 11:19:07 PDT 2014


From: Arik Nemtsov <arik at wizery.com>

Some APs (Cisco) will tack on a weird IE to the end of the TDLS confirm
packet, which can fail negotiation.

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

diff --git a/src/rsn_supp/tdls.c b/src/rsn_supp/tdls.c
index f0ef6c7..d8f7a47 100644
--- a/src/rsn_supp/tdls.c
+++ b/src/rsn_supp/tdls.c
@@ -2297,10 +2297,15 @@ static int wpa_tdls_process_tpk_m3(struct wpa_sm *sm, const u8 *src_addr,
 	pos += 2 /* status code */ + 1 /* dialog token */;
 
 	ielen = len - (pos - buf); /* start of IE in buf */
-	if (wpa_supplicant_parse_ies((const u8 *) pos, ielen, &kde) < 0) {
+
+	/*
+	 * Don't fail if failing to parse IEs. The IEs we need are explicitly
+	 * checked below.
+	 * Some APs piggy-back broken IEs to the end of a TDLS confirm packet,
+	 * which will fail the link if we don't ignore this error.
+	 */
+	if (wpa_supplicant_parse_ies((const u8 *)pos, ielen, &kde) < 0)
 		wpa_printf(MSG_INFO, "TDLS: Failed to parse KDEs in TPK M3");
-		goto error;
-	}
 
 	if (kde.lnkid == NULL || kde.lnkid_len < 3 * ETH_ALEN) {
 		wpa_printf(MSG_INFO, "TDLS: No Link Identifier IE in TPK M3");
-- 
1.7.10.4




More information about the Hostap mailing list