aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBeni Lev <beni.lev@intel.com>2017-01-02 14:26:26 (GMT)
committerJouni Malinen <j@w1.fi>2017-01-05 14:36:14 (GMT)
commite72faadb4955b8206e76a2c6a8e84718fe6a4bac (patch)
tree98f44709f358c58eb7e42ab00555947550ff1428
parent517b5f928f8512e38b1d606a9e4f7d767c31ebd1 (diff)
downloadhostap-e72faadb4955b8206e76a2c6a8e84718fe6a4bac.zip
hostap-e72faadb4955b8206e76a2c6a8e84718fe6a4bac.tar.gz
hostap-e72faadb4955b8206e76a2c6a8e84718fe6a4bac.tar.bz2
bgscan_simple: Fix short_scan_count comparison
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>
-rw-r--r--wpa_supplicant/bgscan_simple.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/wpa_supplicant/bgscan_simple.c b/wpa_supplicant/bgscan_simple.c
index a467cc5..bae72b9 100644
--- a/wpa_supplicant/bgscan_simple.c
+++ b/wpa_supplicant/bgscan_simple.c
@@ -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");