]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Clear EAPOL authWhile and heldWhile values when port is disabled
authorJouni Malinen <j@w1.fi>
Sat, 31 Dec 2011 11:42:23 +0000 (13:42 +0200)
committerJouni Malinen <j@w1.fi>
Sat, 31 Dec 2011 11:42:23 +0000 (13:42 +0200)
IEEE Std 802.1X-2004 does not clear authWhile and heldWhile in this
case, but doing so allows the timer tick to be stopped more quickly when
the port is not enabled. Since these variables are used only within HELD
and RECEIVE states, clearing them on initialization does not change
actual state machine behavior. This reduces some unnecessary operations
in port disabled state and cleans up the wpa_supplicant debug log after
disconnection.

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

src/eapol_supp/eapol_supp_sm.c

index ffc66197a9090edc4942f9519c9bc82a56d88381..0c2fadf7fc490b81bdfb80a969636982e7a1245d 100644 (file)
@@ -268,6 +268,15 @@ SM_STATE(SUPP_PAE, DISCONNECTED)
 
        sm->unicast_key_received = FALSE;
        sm->broadcast_key_received = FALSE;
+
+       /*
+        * IEEE Std 802.1X-2004 does not clear heldWhile here, but doing so
+        * allows the timer tick to be stopped more quickly when the port is
+        * not enabled. Since this variable is used only within HELD state,
+        * clearing it on initialization does not change actual state machine
+        * behavior.
+        */
+       sm->heldWhile = 0;
 }
 
 
@@ -535,6 +544,15 @@ SM_STATE(SUPP_BE, INITIALIZE)
        SM_ENTRY(SUPP_BE, INITIALIZE);
        eapol_sm_abortSupp(sm);
        sm->suppAbort = FALSE;
+
+       /*
+        * IEEE Std 802.1X-2004 does not clear authWhile here, but doing so
+        * allows the timer tick to be stopped more quickly when the port is
+        * not enabled. Since this variable is used only within RECEIVE state,
+        * clearing it on initialization does not change actual state machine
+        * behavior.
+        */
+       sm->authWhile = 0;
 }