]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
TDLS: Add testing mode for disabling TPK expiration
authorJouni Malinen <jouni.malinen@atheros.com>
Thu, 27 Jan 2011 21:43:26 +0000 (23:43 +0200)
committerJouni Malinen <j@w1.fi>
Sun, 6 Mar 2011 12:54:41 +0000 (14:54 +0200)
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

index 73125eddf027f86996f6fc277949b3b369a599ab..0d892d24104a76199f0296dc5541656621ee269a 100644 (file)
@@ -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);
 }