TDLS: Fix concurrent setup test for mac80211 drivers
authorArik Nemtsov <arik@wizery.com>
Mon, 29 Sep 2014 18:47:52 +0000 (20:47 +0200)
committerJouni Malinen <j@w1.fi>
Fri, 3 Oct 2014 08:52:27 +0000 (11:52 +0300)
A recent mac80211 patch ("8f02e6b mac80211: make sure TDLS peer STA
exists during setup") forces the TDLS STA to exist before sending any
mgmt packets. Add the STA before sending a concurrent-setup test packet.

Signed-off-by: Arik Nemtsov <arikx.nemtsov@intel.com>
src/rsn_supp/tdls.c

index 6803fb6..4ea781b 100644 (file)
@@ -1866,6 +1866,8 @@ static int wpa_tdls_process_tpk_m1(struct wpa_sm *sm, const u8 *src_addr,
                wpa_printf(MSG_DEBUG, "TDLS: Testing concurrent initiation of "
                           "TDLS setup - send own request");
                peer->initiator = 1;
+               wpa_sm_tdls_peer_addset(sm, peer->addr, 1, 0, 0, NULL, 0, NULL,
+                                       NULL, 0, NULL, 0, NULL, 0, NULL, 0);
                wpa_tdls_send_tpk_m1(sm, peer);
        }
 
@@ -2044,10 +2046,18 @@ skip_rsn:
        wpa_tdls_generate_tpk(peer, sm->own_addr, sm->bssid);
 
 skip_rsn_check:
+#ifdef CONFIG_TDLS_TESTING
+       if (tdls_testing & TDLS_TESTING_CONCURRENT_INIT)
+               goto skip_add_peer;
+#endif /* CONFIG_TDLS_TESTING */
+
        /* add supported rates, capabilities, and qos_info to the TDLS peer */
        if (wpa_tdls_addset_peer(sm, peer, 1) < 0)
                goto error;
 
+#ifdef CONFIG_TDLS_TESTING
+skip_add_peer:
+#endif /* CONFIG_TDLS_TESTING */
        peer->tpk_in_progress = 1;
 
        wpa_printf(MSG_DEBUG, "TDLS: Sending TDLS Setup Response / TPK M2");