]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Don't start second scan when changing scan interval
authorPontus Fuchs <pontus.fuchs@gmail.com>
Tue, 22 Oct 2013 12:57:21 +0000 (15:57 +0300)
committerJouni Malinen <j@w1.fi>
Tue, 22 Oct 2013 12:57:21 +0000 (15:57 +0300)
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 <pontus.fuchs@gmail.com>

wpa_supplicant/scan.c

index 1a3fe24c99f4cb5b798dff74a96f2ee689a91b36..10287d4ef17f3cdb5771fd0522bfd5e58d37141f 100644 (file)
@@ -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;
 }