[PATCH] Prevent roaming to a different ESS while connected

Jouni Malinen j at w1.fi
Sat Feb 25 09:26:03 EST 2012

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.

Jouni Malinen                                            PGP id EFC895FA

More information about the HostAP mailing list