Patchwork Verify that the selected BSS has a better signal level before roaming

login
register
mail settings
Submitter Robert Shade
Date Nov. 19, 2012, 4:17 a.m.
Message ID <CAMgrJ3bU5fPDGq=PUZKwXaOaVJDAeYOzi3rQZej5ZAJ070bfjQ@mail.gmail.com>
Download mbox | patch
Permalink /patch/199921/
State Accepted
Commit bff954e9a2ee051c23cf9a6dd576873b5dee8544
Headers show

Comments

Robert Shade - Nov. 19, 2012, 4:17 a.m.
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>
---
 wpa_supplicant/events.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

 		if (current_bss->level < -85)
Jouni Malinen - Nov. 24, 2012, 3:20 p.m.
On Sun, Nov 18, 2012 at 11:17:37PM -0500, Robert Shade wrote:
> This prevents situations like the following where we roam to a
> lesser quality BSS just because the signal level delta is over our
> threshold.

Thanks, applied.

> 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

Though, it would be interesting to know how the :e0 BSS got selected in
this case.. Do the APs use different security parameters?
wpa_scan_result_compar() is supposed to order the BSS entries so that
this selection should not have happened in the first place..

Patch

diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c
index 42c4dea..a878735 100644
--- a/wpa_supplicant/events.c
+++ b/wpa_supplicant/events.c
@@ -1025,6 +1025,11 @@  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) {