diff options
author | Stefan Sperling <stsp@cvs.openbsd.org> | 2017-07-22 16:54:47 +0000 |
---|---|---|
committer | Stefan Sperling <stsp@cvs.openbsd.org> | 2017-07-22 16:54:47 +0000 |
commit | 1d030bedf781e15d023584de9bddc704feba1848 (patch) | |
tree | a0b482e0144e09a7c33a6358d551bfc17d0d5220 | |
parent | ed6ea5a35b633868a399aeb7c88a8623536bf147 (diff) |
Make the kernel panic if an invalid state transition occurs in net80211.
Triggers on driver bugs such as those which were fixed in rsu(4) recently.
ok kevlo@
-rw-r--r-- | sys/net80211/ieee80211_proto.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/sys/net80211/ieee80211_proto.c b/sys/net80211/ieee80211_proto.c index 82cfb091af4..2feebe1737f 100644 --- a/sys/net80211/ieee80211_proto.c +++ b/sys/net80211/ieee80211_proto.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ieee80211_proto.c,v 1.77 2017/06/03 15:44:03 tb Exp $ */ +/* $OpenBSD: ieee80211_proto.c,v 1.78 2017/07/22 16:54:46 stsp Exp $ */ /* $NetBSD: ieee80211_proto.c,v 1.8 2004/04/30 23:58:20 dyoung Exp $ */ /*- @@ -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 */ |