Prevent roaming to a different ESS while connected

Submitted by Eyal Shapira on Feb. 19, 2012, 11:28 p.m.

Details

Message ID 1329694136-20465-1-git-send-email-eyal@wizery.com
State Rejected
Headers show

Commit Message

Eyal Shapira Feb. 19, 2012, 11:28 p.m.
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@wizery.com>
---
 wpa_supplicant/events.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

Comments

Jouni Malinen Feb. 25, 2012, 2:26 p.m.
On Mon, Feb 20, 2012 at 01:28:56AM +0200, Eyal Shapira wrote:
> 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.

While I agree that it would be desirable to avoid unnecessary moving
between different ESSes, wpa_supplicant is supposed to support
ESS/network block selection if multiple networks are concerned. This
should be allowed in case the connection to the current ESS is not
usable and another ESS with stronger signal would be available and we
have an enabled network configuration for that ESS. As such, I don't
think I would like to apply this type of change without some additional
conditions that allow network changes based on large signal strength
difference (and/or some kind of mechanism for figuring out the current
connection is not usable).

> diff --git 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,
> +	if (wpa_s->wpa_state >= WPA_AUTHENTICATING &&
> +	    wpa_s->current_ssid &&
> +	    os_memcmp(wpa_s->current_ssid->ssid, ssid_, ssid_len) != 0) {

That would need to verify that wpa_s->current->ssid_len == ssid_len,
too, to make SSID validation correct for all cases.

Patch hide | download patch | download mbox

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) {