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>
This commit is contained in:
Jouni Malinen 2012-06-26 19:51:06 +03:00
parent ccea4eb3e8
commit 460b36d0c0

View File

@ -86,8 +86,11 @@ static int autoscan_exponential_notify_scan(void *priv,
if (data->interval <= 0) if (data->interval <= 0)
data->interval = data->base; data->interval = data->base;
else else {
data->interval = data->interval * data->base; data->interval = data->interval * data->base;
if (data->interval > data->limit)
return data->limit;
}
return data->interval; return data->interval;
} }