From: Pradeep Reddy POTTETI Date: Thu, 15 Oct 2015 06:48:59 +0000 (+0530) Subject: TDLS: On a TPK timeout, tear down the link before renewal by the initiator X-Git-Tag: hostap_2_6~1505 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2bd5bdcd4b1822d0fe4c88f3dd02d0a4ea5913bb;p=thirdparty%2Fhostap.git TDLS: On a TPK timeout, tear down the link before renewal by the initiator 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 --- diff --git a/src/rsn_supp/tdls.c b/src/rsn_supp/tdls.c index 722c20a70..2b47ff8ea 100644 --- a/src/rsn_supp/tdls.c +++ b/src/rsn_supp/tdls.c @@ -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));