Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 19 May 2016 22:02:03 +0000 (UTC)
From:      Andriy Voskoboinyk <avos@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r300237 - head/sys/net80211
Message-ID:  <201605192202.u4JM23sW027245@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: avos
Date: Thu May 19 22:02:03 2016
New Revision: 300237
URL: https://svnweb.freebsd.org/changeset/base/300237

Log:
  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

Modified:
  head/sys/net80211/ieee80211_ioctl.c

Modified: head/sys/net80211/ieee80211_ioctl.c
==============================================================================
--- head/sys/net80211/ieee80211_ioctl.c	Thu May 19 21:47:57 2016	(r300236)
+++ head/sys/net80211/ieee80211_ioctl.c	Thu May 19 22:02:03 2016	(r300237)
@@ -2486,6 +2486,11 @@ ieee80211_scanreq(struct ieee80211vap *v
 	 * 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;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201605192202.u4JM23sW027245>