[PATCH] Adds signal threshold option for auto-reconnect scenarios

Jouni Malinen j at w1.fi
Sat Jun 23 18:18:20 EDT 2012


On Fri, Apr 27, 2012 at 03:26:38PM +0300, Bartosz.Markowski at tieto.com wrote:
> When AP signal level is poor, and we lose connection due to e.g.
> beacon losses, there's a chance we will try to auto-reconnect to
> this AP right after and whole sequence will repeat multiple times.
> 
> This patch adds an option for users to set signal level threshold in
> .conf file and skip auto-reconnect, at least until the signal pass
> this threshold.

> diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c
> @@ -717,6 +717,13 @@ static struct wpa_ssid * wpa_scan_res_match(struct wpa_supplicant *wpa_s,
> +		if (wpa_s->reassociated_connection &&
> +		    wpa_s->conf->reauth_threshold &&
> +		    (bss->level < wpa_s->conf->reauth_threshold)) {
> +			wpa_dbg(wpa_s, MSG_DEBUG, "   skip - signal to low");
> +			continue;
> +		}

That wpa_s->reassociated_connection does not work for figuring out
whether this is a reconnection since it does not seem to be cleared
anywhere (well, ignoring the AP-mode-disable case). I'm actually tempted
to just remove it now that I went through how it is used..

In other words, this would prevent connection below the reauth_threshold
limit even in cases where this is an initial connection to a network.
Was that the purpose of this change or was this supposed to only remove
the continued attempts to reconnect after getting disconnected?

-- 
Jouni Malinen                                            PGP id EFC895FA


More information about the HostAP mailing list