On Fri, Jan 25, 2019 at 09:59:49PM -0500, Ted Unangst wrote: > I'm using a very bad wifi network, which causes iwm much sadness, but this > particular error was new and unexpected. > > Suddenly ping announces the network is down. > ping: sendmsg: Network is down > ping: wrote ox.tedunangst.com 64 chars, ret=-1 > > Sure enough, ifconfig says no network. And now comes the strange part. I run > ifconfig scan and get an error. > > ifconfig: SIOCG80211ALLNODES: Network is down > > Maybe if I had run ifconfig down that would be sensible, but I didn't. My > expectation is that if the interface is up, it will stay up, even if it > disconnects from the network. > > The problem was resolved by running ifconfig up manually. >
Did you observe the UP flag or the RUNNING flag get cleared? I suspect you ended up with UP but not RUNNING because, as far as I can tell, the iwm(4) driver by itself will only clear the RUNNING flag, in iwm_stop(). But the driver itself does not clear the UP flag anywhere. SIOCG80211ALLNODES will return ENETDOWN if either(!) of these flags has been cleared, and this check happens outside of driver-specific code. Maybe this error reporting should be changed to be less misleading somehow? Note that iwm_stop() will run for a variety of reasons, including fatal firmware errors, which the driver will always attempt to recover from. In any case, not RUNNING while UP is a valid state.
