aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorPontus Fuchs <pontus.fuchs@gmail.com>2012-06-12 08:13:19 -0400
committerJohannes Berg <johannes.berg@intel.com>2012-06-13 04:23:21 -0400
commitac4d82fa01c194dba10b9a7c35449ba36eb642fc (patch)
treef4993dbd423f1ed62acb6ebcfe1f873c898d8c67 /net
parente979e33c3972044e1be5e46552a02c3b9c0bc7a7 (diff)
mac80211: Disallow changing chan type on monitor when CHAN_MODE_FIXED
If you add a monitor interface in parallel to a normal interface mac80211 will let you to change the channel type on the monitor interface even if you are connected. Add an explicit check to disallow this. Signed-off-by: Pontus Fuchs <pontus.fuchs@gmail.com> [fix typo in commit log, use sdata instead of netdev] Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net')
-rw-r--r--net/mac80211/cfg.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index 9a974579ba89..cd8b1fb05d42 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -689,7 +689,8 @@ static int ieee80211_set_channel(struct wiphy *wiphy,
689 case CHAN_MODE_HOPPING: 689 case CHAN_MODE_HOPPING:
690 return -EBUSY; 690 return -EBUSY;
691 case CHAN_MODE_FIXED: 691 case CHAN_MODE_FIXED:
692 if (local->oper_channel != chan) 692 if (local->oper_channel != chan ||
693 (!sdata && local->_oper_channel_type != channel_type))
693 return -EBUSY; 694 return -EBUSY;
694 if (!sdata && local->_oper_channel_type == channel_type) 695 if (!sdata && local->_oper_channel_type == channel_type)
695 return 0; 696 return 0;