From dd541b30a4d6648fe69e14d55fe2e955de8be0bb Mon Sep 17 00:00:00 2001 From: Ben Greear Date: Tue, 25 Jan 2011 17:32:10 -0800 Subject: [PATCH 08/16] sme: Start auth timer sooner. Need to start the timer before calling the driver, in case the driver fails and we exit earlier. The timer will still make sure progress is eventually made in this case. Signed-off-by: Ben Greear --- :100644 100644 325ffc5... 3bbc1d7... M wpa_supplicant/sme.c wpa_supplicant/sme.c | 11 ++++++++--- 1 files changed, 8 insertions(+), 3 deletions(-) diff --git a/wpa_supplicant/sme.c b/wpa_supplicant/sme.c index 325ffc5..3bbc1d7 100644 --- a/wpa_supplicant/sme.c +++ b/wpa_supplicant/sme.c @@ -253,16 +253,21 @@ void sme_authenticate(struct wpa_supplicant *wpa_s, wpas_notify_network_changed(wpa_s); wpa_s->sme.auth_alg = params.auth_alg; + + /* 2 second timer seem about right? */ + eloop_register_timeout(SME_AUTH_TIMEOUT, 0, sme_auth_timer, wpa_s, NULL); + if (wpa_drv_authenticate(wpa_s, ¶ms) < 0) { wpa_msg(wpa_s, MSG_INFO, "SME: Authentication request to the " "driver failed"); wpa_supplicant_req_scan(wpa_s, 1, 0); + /* might should call disconnect logic here? Either way, the + * timer above should take care of things if no progress is + * made within 2 seconds. + */ return; } - eloop_register_timeout(SME_AUTH_TIMEOUT, 0, sme_auth_timer, wpa_s, - NULL); - /* * Association will be started based on the authentication event from * the driver. -- 1.6.2.5