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 <jouni@qca.qualcomm.com>
This commit is contained in:
Pradeep Reddy POTTETI 2015-10-15 12:18:59 +05:30 committed by Jouni Malinen
parent faee294f1e
commit 2bd5bdcd4b

View File

@ -627,9 +627,15 @@ static void wpa_tdls_tpk_timeout(void *eloop_ctx, void *timeout_ctx)
*/ */
if (peer->initiator) { if (peer->initiator) {
u8 addr[ETH_ALEN];
wpa_printf(MSG_DEBUG, "TDLS: TPK lifetime expired for " MACSTR wpa_printf(MSG_DEBUG, "TDLS: TPK lifetime expired for " MACSTR
" - try to renew", MAC2STR(peer->addr)); " - 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 { } else {
wpa_printf(MSG_DEBUG, "TDLS: TPK lifetime expired for " MACSTR wpa_printf(MSG_DEBUG, "TDLS: TPK lifetime expired for " MACSTR
" - tear down", MAC2STR(peer->addr)); " - tear down", MAC2STR(peer->addr));