On Tue, Dec 12, 2017 at 02:45:51PM +0100, Stefan Sperling wrote:
> On Tue, Dec 12, 2017 at 02:38:14PM +0100, Stefan Sperling wrote:
> > On Tue, Dec 12, 2017 at 02:17:03PM +0100, Grégoire Jadi wrote:
> > > I tried a simple reboot, and I also repeated the upgrade but it didn't
> > > crash.
> > >
> > > Is there anything else I can try?
> >
> > Nothing so far, apart from trying over and over again.
> >
> > This looks like a race where the device receives a frame before things
> > are fully initialized. Still trying to put my finger on it though, it's
> > still unclear how this can happen exactly.
> >
>
> Grégoire, what does your hostname.iwn0 file look like (without any wifi
> passwords of course)? I'd like to know if there's something about it that
> would cause the kernel to put the driver up/down multiple times, which
> could increase the likelyhood of such races.
>
Nevermind. I have figured it out.
The stupid nasty 'any channel' token bites again:
#define IEEE80211_CHAN_MAX 255
#define IEEE80211_CHAN_ANY 0xffff /* token for ``any channel'' */
#define IEEE80211_CHAN_ANYC \
((struct ieee80211_channel *) IEEE80211_CHAN_ANY)
Whoever thought that was a good idea already owes me some of their lifetime...
Index: ieee80211_node.c
===================================================================
RCS file: /cvs/src/sys/net80211/ieee80211_node.c,v
retrieving revision 1.123
diff -u -p -r1.123 ieee80211_node.c
--- ieee80211_node.c 12 Dec 2017 00:24:21 -0000 1.123
+++ ieee80211_node.c 12 Dec 2017 13:51:19 -0000
@@ -994,6 +994,9 @@ ieee80211_node_checkrssi(struct ieee8021
{
uint8_t thres;
+ if (ni->ni_chan == IEEE80211_CHAN_ANYC)
+ return 0;
+
if (ic->ic_max_rssi) {
thres = (IEEE80211_IS_CHAN_2GHZ(ni->ni_chan)) ?
IEEE80211_RSSI_THRES_RATIO_2GHZ :