From a9bd4b97f0e48a252c17cec4902ea577b08ce35e Mon Sep 17 00:00:00 2001 From: avos Date: Thu, 19 May 2016 22:02:03 +0000 Subject: net80211: restore interface state check for IEEE80211_IOC_SCAN_REQ ioctl. Do not try to start a scan when interface is not running. How-to-reproduce: 1) ifconfig wlan0 create wlandev urtwn0 2) wlandebug -i wlan0 state 3) ifconfig wlan0 scan --- sys/net80211/ieee80211_ioctl.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'sys/net80211') diff --git a/sys/net80211/ieee80211_ioctl.c b/sys/net80211/ieee80211_ioctl.c index 3d93278..b65f23a 100644 --- a/sys/net80211/ieee80211_ioctl.c +++ b/sys/net80211/ieee80211_ioctl.c @@ -2486,6 +2486,11 @@ ieee80211_scanreq(struct ieee80211vap *vap, struct ieee80211_scan_req *sr) * Otherwise just invoke the scan machinery directly. */ IEEE80211_LOCK(ic); + if (ic->ic_nrunning == 0) { + IEEE80211_UNLOCK(ic); + return ENXIO; + } + if (vap->iv_state == IEEE80211_S_INIT) { /* NB: clobbers previous settings */ vap->iv_scanreq_flags = sr->sr_flags; -- cgit v1.1