cfg80211: refuse to .set_monitor_channel when non-monitors are present
authorMichal Kazior <michal.kazior@tieto.com>
Fri, 29 Jun 2012 10:47:03 +0000 (12:47 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Fri, 29 Jun 2012 11:39:17 +0000 (13:39 +0200)
Having .set_monitor_channel work with non-monitor
interfaces running would make interface
combinations accounting ambiguous.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/wireless/chan.c

index 167e7cb60089d348135543441a2dc810e71ce25b..019401b0b5e3029a994ed70233b276f8cbc4a6ef 100644 (file)
@@ -85,6 +85,8 @@ int cfg80211_set_monitor_channel(struct cfg80211_registered_device *rdev,
 
        if (!rdev->ops->set_monitor_channel)
                return -EOPNOTSUPP;
+       if (!cfg80211_has_monitors_only(rdev))
+               return -EBUSY;
 
        chan = rdev_freq_to_chan(rdev, freq, chantype);
        if (!chan)