Bug#403045: [pkg-wpa-devel] Bug#403045: wpasupplicant: race condition in wpa_action disconnect between ifdown and if_post_down_up

Kel Modderman kelmo at kanotixguide.org
Fri Dec 15 04:33:12 CET 2006


Hi Henning,

On Thursday 14 December 2006 20:33, Henning Glawe wrote:
> I have configured a roaming wpa configuration on my laptop using
>
> allow-hotplug wlan0
> iface wlan0 inet manual
>         wpa-driver wext
> 		wpa-roam /etc/wpa_supplicant.conf
>
> in /etc/network/interfaces.
>
> If a disconnect event occurs, wpa_action is called with the action
> DISCONNECTED, which "ifdown"s the interface and then should immediately
> re-enable the scanning mode by calling
> /etc/wpa_supplicant/functions.sh::if_post_down_up

Yep. Definitely a candidate area for some raciness.

>
> the problem is, at least in my case, that the link is _down_ afterwards,
> so wpasupplicant is not able to scan further. This seems to be caused by
> the interface not being completely downed yet when ifdown finishes;
> putting a 'sleep 1' into functions.sh::ifdown immediately after the call
> to /sbin/ifdown "solves" this problem.

Yeah, I'm not a fan of unconditional sleeps though.

Do you have iproute installed? That slighly changes behaviour of 
if_post_down_up, causing the interface to be flushed before 'upping' it 
again.

Perhaps adding a `ifconfig $WPA_IFACE down' on the line before  `ifconfig 
$WPA_IFACE up' in if_post_down_up would help in cases where iproute is not 
installed.

In any case, ifdown should not exit until it has fully completed what it had 
to do with the interface, at least in my opinion.

Thanks, Kel.







More information about the Pkg-wpa-devel mailing list