From: Pontus Fuchs Date: Tue, 12 Jun 2012 12:13:19 +0000 (+0200) Subject: mac80211: Disallow changing chan type on monitor when CHAN_MODE_FIXED X-Git-Tag: v3.6-rc1~125^2~57^2~1^2~118 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ac4d82fa01c194dba10b9a7c35449ba36eb642fc;p=platform%2Fkernel%2Flinux-stable.git 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 [fix typo in commit log, use sdata instead of netdev] Signed-off-by: Johannes Berg --- diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index 9a97457..cd8b1fb 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c @@ -689,7 +689,8 @@ static int ieee80211_set_channel(struct wiphy *wiphy, case CHAN_MODE_HOPPING: return -EBUSY; case CHAN_MODE_FIXED: - if (local->oper_channel != chan) + if (local->oper_channel != chan || + (!sdata && local->_oper_channel_type != channel_type)) return -EBUSY; if (!sdata && local->_oper_channel_type == channel_type) return 0;