]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
bgscan_simple: Fix short_scan_count comparison
authorBeni Lev <beni.lev@intel.com>
Mon, 2 Jan 2017 14:26:26 +0000 (16:26 +0200)
committerJouni Malinen <j@w1.fi>
Thu, 5 Jan 2017 14:36:14 +0000 (16:36 +0200)
Previously, the check was done after we reached the maximum and another
scan was already triggered.

While at it, remove an irrelevant comment that the previous change in
the logic here missed.

Signed-off-by: Beni Lev <beni.lev@intel.com>
wpa_supplicant/bgscan_simple.c

index a467cc5b927195c79cfea7fd19b37f8f54bd3abe..bae72b934a3b173b3d62d8b51db502cb2a0105d8 100644 (file)
@@ -56,12 +56,7 @@ static void bgscan_simple_timeout(void *eloop_ctx, void *timeout_ctx)
        } else {
                if (data->scan_interval == data->short_interval) {
                        data->short_scan_count++;
-                       /*
-                        * Spend at most the duration of a long scan interval
-                        * scanning at the short scan interval. After that,
-                        * revert to the long scan interval.
-                        */
-                       if (data->short_scan_count > data->max_short_scans) {
+                       if (data->short_scan_count >= data->max_short_scans) {
                                data->scan_interval = data->long_interval;
                                wpa_printf(MSG_DEBUG, "bgscan simple: Backing "
                                           "off to long scan interval");