summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichal Kazior <michal.kazior@tieto.com>2012-06-29 10:47:03 (GMT)
committerJohannes Berg <johannes.berg@intel.com>2012-06-29 11:39:17 (GMT)
commit4f03c1ed8901a01ad4abcef95c02c007a2d481c2 (patch)
tree7b0dbbf9413cb0aa314bf8cdd1c17684261b7659
parent870d37fc22f3e40f9f23e06c581c8538fc16a2f0 (diff)
downloadlinux-4f03c1ed8901a01ad4abcef95c02c007a2d481c2.tar.xz
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>
-rw-r--r--net/wireless/chan.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/net/wireless/chan.c b/net/wireless/chan.c
index 167e7cb..019401b 100644
--- a/net/wireless/chan.c
+++ b/net/wireless/chan.c
@@ -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)