The rsu(4) driver got subtly broken in -current because it did an
invalid state transition in net80211 and hence didn't actually run
some of the net80211 setup code after association.

To make diagnosing such bugs easier in the future I propose we make
the system panic when an invalid state transition occurs in net80211.

Doesn't blow up iwm(4). I suppose further testing can happen in-tree.

Index: ieee80211_proto.c
===================================================================
RCS file: /cvs/src/sys/net80211/ieee80211_proto.c,v
retrieving revision 1.77
diff -u -p -r1.77 ieee80211_proto.c
--- ieee80211_proto.c   3 Jun 2017 15:44:03 -0000       1.77
+++ ieee80211_proto.c   21 Jul 2017 16:47:53 -0000
@@ -981,7 +981,9 @@ justcleanup:
                ni->ni_rsn_supp_state = RSNA_SUPP_INITIALIZE;
                switch (ostate) {
                case IEEE80211_S_INIT:
-                       DPRINTF(("invalid transition\n"));
+                       panic("invalid transition %s -> %s",
+                           ieee80211_state_name[ostate],
+                           ieee80211_state_name[nstate]);
                        break;
                case IEEE80211_S_SCAN:
                        IEEE80211_SEND_MGMT(ic, ni,
@@ -1021,7 +1023,9 @@ justcleanup:
                case IEEE80211_S_INIT:
                case IEEE80211_S_SCAN:
                case IEEE80211_S_ASSOC:
-                       DPRINTF(("invalid transition\n"));
+                       panic("invalid transition %s -> %s",
+                           ieee80211_state_name[ostate],
+                           ieee80211_state_name[nstate]);
                        break;
                case IEEE80211_S_AUTH:
                        IEEE80211_SEND_MGMT(ic, ni,
@@ -1038,7 +1042,9 @@ justcleanup:
                case IEEE80211_S_INIT:
                case IEEE80211_S_AUTH:
                case IEEE80211_S_RUN:
-                       DPRINTF(("invalid transition\n"));
+                       panic("invalid transition %s -> %s",
+                           ieee80211_state_name[ostate],
+                           ieee80211_state_name[nstate]);
                        break;
                case IEEE80211_S_SCAN:          /* adhoc/hostap mode */
                case IEEE80211_S_ASSOC:         /* infra mode */

Reply via email to