kern/153594: [iwn] Network keeps disconnecting when
/etc/rc.d/netif restart is run
Bernhard Schmidt
bschmidt at freebsd.org
Tue Jan 4 09:05:58 UTC 2011
On Tuesday, January 04, 2011 09:08:24 Eugene Grosbein wrote:
> > There is race in devd and our rc-subsystem if wpa_supplicant is involved
> > effectivly resulting in starting wpa_supplicant twice. Both instances try
> > to take over the wlan device which results in what you are seeing.
> > I have no idea how to fix this right now, so this has to wait until I'm
> > able to think of proper fix.
>
> Perhaps, wrapping wpa_supplicant invocation into "lockf -t0" would help
> to eliminate race?
Possibly, but I don't think this is the way to go.
Currently wpa_supplicant has this code:
/*
* Mark the interface as down to ensure wpa_supplicant has exclusive
* access to the net80211 state machine, do this before opening the
* route socket to avoid a false event that the interface disappeared.
*/
if (getifflags(drv, &flags) == 0)
(void) setifflags(drv, flags &~ IFF_UP);
This code works such that it will send an event to already running
wpa_supplicant instances which will then terminate. This does indeed work if
there's enough delay between invocations, though, if there is just a small
delay (~100ms or something), that event doesn't get passed probably. I think
we should start looking into possible solution at that point, trying to figure
out why the the event doesn't get passed (probably because the interface is
not yet up at that point) will get us closer to proper solution.
--
Bernhard
More information about the freebsd-net
mailing list