From: Jouni Malinen Date: Sun, 26 Aug 2012 20:19:32 +0000 (+0300) Subject: Clear idleWhile timer when EAP peer state machine is not in use X-Git-Tag: hostap_2_0~322 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=09bcf3be9c32252b9b4aba1161b35384edfe9f82;p=thirdparty%2Fhostap.git Clear idleWhile timer when EAP peer state machine is not in use This allows the EAPOL tick timer to be stopped more quickly when getting disconnected. Signed-hostap: Jouni Malinen --- diff --git a/src/eap_peer/eap.c b/src/eap_peer/eap.c index c19f98192..ba973a52a 100644 --- a/src/eap_peer/eap.c +++ b/src/eap_peer/eap.c @@ -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); } diff --git a/src/eapol_supp/eapol_supp_sm.c b/src/eapol_supp/eapol_supp_sm.c index 85035545c..e3bfa38a6 100644 --- a/src/eapol_supp/eapol_supp_sm.c +++ b/src/eapol_supp/eapol_supp_sm.c @@ -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; } }