From c6f5dec9c10ecddb419227acbb7860c44991029d Mon Sep 17 00:00:00 2001 From: Pontus Fuchs Date: Tue, 22 Oct 2013 15:57:21 +0300 Subject: [PATCH] Don't start second scan when changing scan interval If a scan is currently running and the scan interval is changed, a second scan will be started before the current has finished. This will in turn, if no networks are configured, cause wpa_s->state to be forced to WPA_INACTIVE before the first scan has finished. Signed-hostap: Pontus Fuchs --- wpa_supplicant/scan.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/wpa_supplicant/scan.c b/wpa_supplicant/scan.c index 1a3fe24c9..10287d4ef 100644 --- a/wpa_supplicant/scan.c +++ b/wpa_supplicant/scan.c @@ -887,8 +887,10 @@ void wpa_supplicant_update_scan_int(struct wpa_supplicant *wpa_s, int sec) new_int.usec = remaining.usec; } - eloop_register_timeout(new_int.sec, new_int.usec, wpa_supplicant_scan, - wpa_s, NULL); + if (cancelled) { + eloop_register_timeout(new_int.sec, new_int.usec, + wpa_supplicant_scan, wpa_s, NULL); + } wpa_s->scan_interval = sec; }