From 1d030bedf781e15d023584de9bddc704feba1848 Mon Sep 17 00:00:00 2001 From: Stefan Sperling Date: Sat, 22 Jul 2017 16:54:47 +0000 Subject: 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@ --- sys/net80211/ieee80211_proto.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'sys/net80211') 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 */ -- cgit v1.2.3