Date: Tue, 4 Jan 2011 10:39:47 +0100 From: Bernhard Schmidt <bschmidt@freebsd.org> To: Eugene Grosbein <egrosbein@rdtc.ru> Cc: freebsd-net@freebsd.org, bug-followup@freebsd.org Subject: Re: kern/153594: [iwn] Network keeps disconnecting when /etc/rc.d/netif restart is run Message-ID: <201101041039.48130.bschmidt@freebsd.org> In-Reply-To: <4D22E3BB.4050703@rdtc.ru> References: <4D22D578.8080903@rdtc.ru> <201101041006.06065.bschmidt@freebsd.org> <4D22E3BB.4050703@rdtc.ru>
next in thread | previous in thread | raw e-mail | index | archive | help
On Tuesday, January 04, 2011 10:09:15 Eugene Grosbein wrote: > On 04.01.2011 15:06, Bernhard Schmidt wrote: > >> 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. > > Proper fine-grained locking was always good solution for race problem :-) > How about using flock(2) in wpa_supplicant source code? I don't see any flock'able resource shared between instances, do you? -- Bernhard
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201101041039.48130.bschmidt>