]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Re-initialize EAP ClientTimeout on for each session
authorJouni Malinen <jouni.malinen@atheros.com>
Tue, 28 Dec 2010 10:09:14 +0000 (12:09 +0200)
committerJouni Malinen <j@w1.fi>
Tue, 28 Dec 2010 10:09:14 +0000 (12:09 +0200)
ClientTimeout changes from EAP peer methods were not supposed to
change behavior for other EAP peer methods or even other sessions
of the same method. Re-initialize ClientTimeout whenever an EAP
peer method is initialized to avoid this. This addresses problems
where WPS (EAP-WSC) reduces the timeout and consecutive EAP runs
may fail due to too small timeout.

src/eap_peer/eap.c

index 482934ae8e94b695c2f3c30566e5a75f371d0565..330164ae0edbbfe218eb96fce970a75b2ffc9df9 100644 (file)
@@ -37,6 +37,7 @@
 #define STATE_MACHINE_DEBUG_PREFIX "EAP"
 
 #define EAP_MAX_AUTH_ROUNDS 50
+#define EAP_CLIENT_TIMEOUT_DEFAULT 60
 
 
 static Boolean eap_sm_allowMethod(struct eap_sm *sm, int vendor,
@@ -268,6 +269,8 @@ SM_STATE(EAP, GET_METHOD)
                goto nak;
        }
 
+       sm->ClientTimeout = EAP_CLIENT_TIMEOUT_DEFAULT;
+
        wpa_printf(MSG_DEBUG, "EAP: Initialize selected EAP method: "
                   "vendor %u method %u (%s)",
                   sm->reqVendor, method, sm->m->name);
@@ -1241,7 +1244,7 @@ struct eap_sm * eap_peer_sm_init(void *eapol_ctx,
        sm->eapol_ctx = eapol_ctx;
        sm->eapol_cb = eapol_cb;
        sm->msg_ctx = msg_ctx;
-       sm->ClientTimeout = 60;
+       sm->ClientTimeout = EAP_CLIENT_TIMEOUT_DEFAULT;
        sm->wps = conf->wps;
 
        os_memset(&tlsconf, 0, sizeof(tlsconf));