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;
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to