aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/blacklist.c
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2012-11-25 14:20:44 (GMT)
committerJouni Malinen <j@w1.fi>2012-11-25 14:20:44 (GMT)
commitf1a526338916ce4dc81bcab922b80911ae108d1c (patch)
tree0ee636151f11028a1b2261b22d4c92154705474f /wpa_supplicant/blacklist.c
parent4115303bbe77ff0db40b489af92f47fc5ea2c9ad (diff)
downloadhostap-f1a526338916ce4dc81bcab922b80911ae108d1c.zip
hostap-f1a526338916ce4dc81bcab922b80911ae108d1c.tar.gz
hostap-f1a526338916ce4dc81bcab922b80911ae108d1c.tar.bz2
Maintain maximum blacklist count over list clear operations
wpas_connection_failed() uses the blacklist count to figure out a suitable time to wait for the next scan. This mechanism did not work properly in cases where the temporary blacklist gets cleared due to no other BSSes being available. Address this by maintaining an additional count of blacklisting values over wpa_blacklist_clear() calls. In addition, add one more step in the count to timeout mapping to go to 10 second interval if more than four failures are seen. Signed-hostap: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'wpa_supplicant/blacklist.c')
-rw-r--r--wpa_supplicant/blacklist.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/wpa_supplicant/blacklist.c b/wpa_supplicant/blacklist.c
index 2e01e7f..e53dc38 100644
--- a/wpa_supplicant/blacklist.c
+++ b/wpa_supplicant/blacklist.c
@@ -123,14 +123,19 @@ int wpa_blacklist_del(struct wpa_supplicant *wpa_s, const u8 *bssid)
void wpa_blacklist_clear(struct wpa_supplicant *wpa_s)
{
struct wpa_blacklist *e, *prev;
+ int max_count = 0;
e = wpa_s->blacklist;
wpa_s->blacklist = NULL;
while (e) {
+ if (e->count > max_count)
+ max_count = e->count;
prev = e;
e = e->next;
wpa_printf(MSG_DEBUG, "Removed BSSID " MACSTR " from "
"blacklist (clear)", MAC2STR(prev->bssid));
os_free(prev);
}
+
+ wpa_s->extra_blacklist_count += max_count;
}