[PATCH] Prevent roaming to a different ESS while connected

Eyal Shapira eyal at wizery.com
Sun Feb 19 18:28:56 EST 2012


While connected to a certain ESS prevent roaming to a different
ESS AP even if its signal is better. This prevents an undesired
switch between networks in this example scenario:
2 network profiles configured Net1 and Net2. We're already associated
to an AP on the ESS Net1 and while walking with the device we get close
to an AP from ESS Net2. Before this change a decision to switch to
Net2 was made.

Signed-hostap: Eyal Shapira <eyal at wizery.com>
---
 wpa_supplicant/events.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c
index 0cc1fc2..256d2a9 100644
--- a/wpa_supplicant/events.c
+++ b/wpa_supplicant/events.c
@@ -632,6 +632,14 @@ static struct wpa_ssid * wpa_scan_res_match(struct wpa_supplicant *wpa_s,
 		return NULL;
 	}
 
+	if (wpa_s->wpa_state >= WPA_AUTHENTICATING &&
+	    wpa_s->current_ssid &&
+	    os_memcmp(wpa_s->current_ssid->ssid, ssid_, ssid_len) != 0) {
+		wpa_dbg(wpa_s, MSG_DEBUG, "   skip - block roaming to "
+			"a different SSID while connected");
+		return NULL;
+	}
+
 	wpa = wpa_ie_len > 0 || rsn_ie_len > 0;
 
 	for (ssid = group; ssid; ssid = ssid->pnext) {
-- 
1.7.4.1



More information about the HostAP mailing list