]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
TDLS: On a TPK timeout, tear down the link before renewal by the initiator
authorPradeep Reddy POTTETI <c_ppotte@qti.qualcomm.com>
Thu, 15 Oct 2015 06:48:59 +0000 (12:18 +0530)
committerJouni Malinen <j@w1.fi>
Fri, 16 Oct 2015 08:35:19 +0000 (11:35 +0300)
On TPK lifetime expiration, tear down the direct link before renewing
the link in the case of TDLS initiator processing. The expired key
cannot be used anymore, so it is better to explicitly tear down the old
link first.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
src/rsn_supp/tdls.c

index 722c20a706f9d30dac16089ef48f44e7d3e2fcf4..2b47ff8ea23e7d28a23139dd7cbf9de9d8edad34 100644 (file)
@@ -627,9 +627,15 @@ static void wpa_tdls_tpk_timeout(void *eloop_ctx, void *timeout_ctx)
         */
 
        if (peer->initiator) {
+               u8 addr[ETH_ALEN];
+
                wpa_printf(MSG_DEBUG, "TDLS: TPK lifetime expired for " MACSTR
                           " - try to renew", MAC2STR(peer->addr));
-               wpa_tdls_start(sm, peer->addr);
+               /* cache the peer address before do_teardown */
+               os_memcpy(addr, peer->addr, ETH_ALEN);
+               wpa_tdls_do_teardown(sm, peer,
+                                    WLAN_REASON_TDLS_TEARDOWN_UNSPECIFIED);
+               wpa_tdls_start(sm, addr);
        } else {
                wpa_printf(MSG_DEBUG, "TDLS: TPK lifetime expired for " MACSTR
                           " - tear down", MAC2STR(peer->addr));