aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/autoscan_exponential.c
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2012-06-26 16:51:06 (GMT)
committerJouni Malinen <j@w1.fi>2012-06-26 16:51:06 (GMT)
commit460b36d0c0c30c42ed5337378959a88e9a108213 (patch)
tree7c819e41d9d463a13dec865784805fa47d4a10cc /wpa_supplicant/autoscan_exponential.c
parentccea4eb3e854db485dc1c924bf32bd78b2f2b52f (diff)
downloadhostap-460b36d0c0c30c42ed5337378959a88e9a108213.zip
hostap-460b36d0c0c30c42ed5337378959a88e9a108213.tar.gz
hostap-460b36d0c0c30c42ed5337378959a88e9a108213.tar.bz2
Fix autoscan exponential to limit interval in all cases
The first time the limit is exceeded could result in using larger value - avoid that by limiting the interval also in that case. Signed-hostap: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'wpa_supplicant/autoscan_exponential.c')
-rw-r--r--wpa_supplicant/autoscan_exponential.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/wpa_supplicant/autoscan_exponential.c b/wpa_supplicant/autoscan_exponential.c
index 4f743fd..424477b 100644
--- a/wpa_supplicant/autoscan_exponential.c
+++ b/wpa_supplicant/autoscan_exponential.c
@@ -86,8 +86,11 @@ static int autoscan_exponential_notify_scan(void *priv,
if (data->interval <= 0)
data->interval = data->base;
- else
+ else {
data->interval = data->interval * data->base;
+ if (data->interval > data->limit)
+ return data->limit;
+ }
return data->interval;
}