]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Clear idleWhile timer when EAP peer state machine is not in use
authorJouni Malinen <j@w1.fi>
Sun, 26 Aug 2012 20:19:32 +0000 (23:19 +0300)
committerJouni Malinen <j@w1.fi>
Sun, 26 Aug 2012 20:35:08 +0000 (23:35 +0300)
This allows the EAPOL tick timer to be stopped more quickly when
getting disconnected.

Signed-hostap: Jouni Malinen <j@w1.fi>

src/eap_peer/eap.c
src/eapol_supp/eapol_supp_sm.c

index c19f981928d99af005b866847310d65e3e60e065..ba973a52adafaed57966bb17415ef1de353a3cf2 100644 (file)
@@ -189,6 +189,12 @@ SM_STATE(EAP, DISABLED)
 {
        SM_ENTRY(EAP, DISABLED);
        sm->num_rounds = 0;
+       /*
+        * RFC 4137 does not describe clearing of idleWhile here, but doing so
+        * allows the timer tick to be stopped more quickly when EAP is not in
+        * use.
+        */
+       eapol_set_int(sm, EAPOL_idleWhile, 0);
 }
 
 
index 85035545cc6caf373d18acd2b4f5696becde3bb7..e3bfa38a67821d2e665b637053fcbbffc86a1b1c 100644 (file)
@@ -1744,7 +1744,8 @@ static void eapol_sm_set_int(void *ctx, enum eapol_int_var variable,
        switch (variable) {
        case EAPOL_idleWhile:
                sm->idleWhile = value;
-               eapol_enable_timer_tick(sm);
+               if (sm->idleWhile > 0)
+                       eapol_enable_timer_tick(sm);
                break;
        }
 }