From 460b36d0c0c30c42ed5337378959a88e9a108213 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Tue, 26 Jun 2012 19:51:06 +0300 Subject: [PATCH] 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 --- wpa_supplicant/autoscan_exponential.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/wpa_supplicant/autoscan_exponential.c b/wpa_supplicant/autoscan_exponential.c index 4f743fd14..424477be8 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; }