]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
TDLS: Fix concurrent initialization test code
authorJouni Malinen <jouni@qca.qualcomm.com>
Thu, 27 Oct 2011 20:12:08 +0000 (23:12 +0300)
committerJouni Malinen <j@w1.fi>
Thu, 27 Oct 2011 20:12:08 +0000 (23:12 +0300)
Must not use data from peer TDLS Setup Request if the concurrent
initialization from us is supposed to be the one that gets completed.

src/rsn_supp/tdls.c

index 415b0a9e042cbcc42f80954fff15395656a0fc28..b336ba9db92298592b800d6e801d0b317ac08b3e 100644 (file)
@@ -1553,6 +1553,19 @@ skip_rsn:
                }
        }
 
+#ifdef CONFIG_TDLS_TESTING
+       if (tdls_testing & TDLS_TESTING_CONCURRENT_INIT) {
+               if (os_memcmp(sm->own_addr, peer->addr, ETH_ALEN) < 0) {
+                       /*
+                        * The request frame from us is going to win, so do not
+                        * replace information based on this request frame from
+                        * the peer.
+                        */
+                       goto skip_rsn_check;
+               }
+       }
+#endif /* CONFIG_TDLS_TESTING */
+
        peer->initiator = 0; /* Need to check */
        peer->dtoken = dtoken;