aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/events.c
diff options
context:
space:
mode:
authorRobert Shade <robert.shade@gmail.com>2012-11-24 15:17:50 (GMT)
committerJouni Malinen <j@w1.fi>2012-11-24 15:17:50 (GMT)
commitbff954e9a2ee051c23cf9a6dd576873b5dee8544 (patch)
tree45c5854075cd262da2281c9403e3f7aa37e6edf2 /wpa_supplicant/events.c
parentfb660a9431f881ea6dbba2967094605ad64398ee (diff)
downloadhostap-bff954e9a2ee051c23cf9a6dd576873b5dee8544.zip
hostap-bff954e9a2ee051c23cf9a6dd576873b5dee8544.tar.gz
hostap-bff954e9a2ee051c23cf9a6dd576873b5dee8544.tar.bz2
Verify that the selected BSS has a better signal level before roaming
This prevents situations like the following where we roam to a lesser quality BSS just because the signal level delta is over our threshold. wlan0: Considering within-ESS reassociation wlan0: Current BSS: 00:24:6c:74:0a:40 level=-51 wlan0: Selected BSS: 00:24:6c:74:0a:e0 level=-64 wlan0: Request association: reassociate: 0 selected: 00:24:6c:74:0a:e0 bssid: 00:24:6c:74:0a:40 pending: 00:00:00:00:00:00 wpa_state: COMPLETED Signed-hostap: Robert Shade <robert.shade@gmail.com>
Diffstat (limited to 'wpa_supplicant/events.c')
-rw-r--r--wpa_supplicant/events.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c
index 42c4dea..03c4d2f 100644
--- a/wpa_supplicant/events.c
+++ b/wpa_supplicant/events.c
@@ -1025,6 +1025,12 @@ static int wpa_supplicant_need_to_roam(struct wpa_supplicant *wpa_s,
return 1;
}
+ if (current_bss->level < 0 && current_bss->level > selected->level) {
+ wpa_dbg(wpa_s, MSG_DEBUG, "Skip roam - Current BSS has better "
+ "signal level");
+ return 0;
+ }
+
min_diff = 2;
if (current_bss->level < 0) {
if (current_bss->level < -85)