Re: [PATCH] remove AP always on device disconnect



On Fri, 2011-10-07 at 15:21 +0200, Ludwig Nussel wrote:
> This avoids immediate reconnect after link timeout to an AP that may no longer exist (down/out of range). This also avoids needless prompting for a password for the no longer existing AP.

This could work, but I think we need to restrict the AP removal to cases
where the supplicant times out after we've already been successfully
connected, which is basically the case you're talking about.  For
example, in the case of an explicit disconnect (via the menu item or
D-Bus call) we'd remove a perfectly good AP and might not find it again
until the next scan happened a few minutes after the disconnect.

Maybe instead of doing it during deactivate, remove the AP in
supplicant_connection_timeout_cb() right before moving to the
DISCONNECTED state?

Dan

> ---
>  src/nm-device-wifi.c |   12 +++---------
>  1 files changed, 3 insertions(+), 9 deletions(-)
> 
> diff --git a/src/nm-device-wifi.c b/src/nm-device-wifi.c
> index 42080ae..e73ab92 100644
> --- a/src/nm-device-wifi.c
> +++ b/src/nm-device-wifi.c
> @@ -1285,15 +1285,9 @@ real_deactivate (NMDevice *dev)
>  	set_current_ap (self, NULL);
>  	priv->rate = 0;
>  
> -	/* If the AP is 'fake', i.e. it wasn't actually found from
> -	 * a scan but the user tried to connect to it manually (maybe it
> -	 * was non-broadcasting or something) get rid of it, because 'fake'
> -	 * APs should only live for as long as we're connected to them.  Fixes
> -	 * a bug where user-created Ad-Hoc APs are never removed from the scan
> -	 * list, because scanning is disabled while in Ad-Hoc mode (for stability),
> -	 * and thus the AP culling never happens. (bgo #569241)
> -	 */
> -	if (orig_ap && nm_ap_get_fake (orig_ap)) {
> +	/* remove ap always. If it's still there it will re-appear on next
> +	 * scan. Avoids reconnect when is no longer available */
> +	if (orig_ap /* && nm_ap_get_fake (orig_ap) */) {
>  		access_point_removed (self, orig_ap);
>  		priv->ap_list = g_slist_remove (priv->ap_list, orig_ap);
>  		g_object_unref (orig_ap);




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]