From: Pontus Fuchs <pontus.fuchs@gmail.com>
To: johannes@sipsolutions.net, linville@tuxdriver.com
Cc: linux-wireless@vger.kernel.org, Pontus Fuchs <pontus.fuchs@gmail.com>
Subject: [PATCH v2] mac80211: Disallow changing chan type on monitor when CHAN_MODE_FIXED
Date: Tue, 12 Jun 2012 14:13:19 +0200 [thread overview]
Message-ID: <1339503199-1237-1-git-send-email-pontus.fuchs@gmail.com> (raw)
If you add a monitor interface in paralell 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>
---
net/mac80211/cfg.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index 498c94e..a87591b 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 ||
+ (!netdev && local->_oper_channel_type != channel_type))
return -EBUSY;
if (!sdata && local->_oper_channel_type == channel_type)
return 0;
--
1.7.5.4
next reply other threads:[~2012-06-12 12:13 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-12 12:13 Pontus Fuchs [this message]
2012-06-13 8:23 ` [PATCH v2] mac80211: Disallow changing chan type on monitor when CHAN_MODE_FIXED Johannes Berg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1339503199-1237-1-git-send-email-pontus.fuchs@gmail.com \
--to=pontus.fuchs@gmail.com \
--cc=johannes@sipsolutions.net \
--cc=linux-wireless@vger.kernel.org \
--cc=linville@tuxdriver.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.