From ad79dba127fa29b8b95dd131e9b11c7088f0eba4 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Thu, 27 Jan 2011 23:43:26 +0200 Subject: [PATCH] TDLS: Add testing mode for disabling TPK expiration tdls_testing 0x104 can now be used to disable expiration of TPK (0x100) and to use a short lifetime when initiating link (0x4). --- src/rsn_supp/tdls.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/rsn_supp/tdls.c b/src/rsn_supp/tdls.c index 73125eddf..0d892d241 100644 --- a/src/rsn_supp/tdls.c +++ b/src/rsn_supp/tdls.c @@ -36,6 +36,7 @@ #define TDLS_TESTING_WRONG_LIFETIME_CONF BIT(5) #define TDLS_TESTING_LONG_LIFETIME BIT(6) #define TDLS_TESTING_CONCURRENT_INIT BIT(7) +#define TDLS_TESTING_NO_TPK_EXPIRATION BIT(8) unsigned int tdls_testing = 0; #endif /* CONFIG_TDLS_TESTING */ @@ -1445,6 +1446,13 @@ static void wpa_tdls_enable_link(struct wpa_sm *sm, struct wpa_tdls_peer *peer) lifetime -= 3; eloop_register_timeout(lifetime, 0, wpa_tdls_tpk_timeout, sm, peer); +#ifdef CONFIG_TDLS_TESTING + if (tdls_testing & TDLS_TESTING_NO_TPK_EXPIRATION) { + wpa_printf(MSG_DEBUG, "TDLS: Testing - disable TPK " + "expiration"); + eloop_cancel_timeout(wpa_tdls_tpk_timeout, sm, peer); + } +#endif /* CONFIG_TDLS_TESTING */ } wpa_sm_tdls_oper(sm, TDLS_ENABLE_LINK, peer->addr); }