wpa_supplicant: Do not allow too short sched scan
authorDavid Spinadel <david.spinadel@intel.com>
Sun, 10 Mar 2013 15:27:48 +0000 (17:27 +0200)
committerJouni Malinen <j@w1.fi>
Sun, 10 Mar 2013 15:27:48 +0000 (17:27 +0200)
In case that the ssid list is longer than max number of ssids,
ths scheduled scan aborted after timeout and rescheduled again
with shorter timeout and longer interval. In case that the timeout
is shorter than the interval, only one scan iteration will
be run. In this case, go back to the initial values.

Signed-hostap: David Spinadel <david.spinadel@intel.com>

wpa_supplicant/scan.c

index c3f9981..fdf06c0 100644 (file)
@@ -1118,6 +1118,10 @@ scan:
                wpa_s->first_sched_scan = 0;
                wpa_s->sched_scan_timeout /= 2;
                wpa_s->sched_scan_interval *= 2;
+               if (wpa_s->sched_scan_timeout < wpa_s->sched_scan_interval) {
+                       wpa_s->sched_scan_interval = 10;
+                       wpa_s->sched_scan_timeout = max_sched_scan_ssids * 2;
+               }
        }
 
        return 0;