浏览代码

cfg80211: refuse to .set_monitor_channel when non-monitors are present

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>
Michal Kazior 13 年之前
父节点
当前提交
4f03c1ed89
共有 1 个文件被更改,包括 2 次插入0 次删除
  1. 2 0
      net/wireless/chan.c

+ 2 - 0
net/wireless/chan.c

@@ -85,6 +85,8 @@ int cfg80211_set_monitor_channel(struct cfg80211_registered_device *rdev,
 
 
 	if (!rdev->ops->set_monitor_channel)
 	if (!rdev->ops->set_monitor_channel)
 		return -EOPNOTSUPP;
 		return -EOPNOTSUPP;
+	if (!cfg80211_has_monitors_only(rdev))
+		return -EBUSY;
 
 
 	chan = rdev_freq_to_chan(rdev, freq, chantype);
 	chan = rdev_freq_to_chan(rdev, freq, chantype);
 	if (!chan)
 	if (!chan)