linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] mac80211: Disallow changing chan type on monitor when CHAN_MODE_FIXED
@ 2012-06-12 12:13 Pontus Fuchs
  2012-06-13  8:23 ` Johannes Berg
  0 siblings, 1 reply; 2+ messages in thread
From: Pontus Fuchs @ 2012-06-12 12:13 UTC (permalink / raw)
  To: johannes, linville; +Cc: linux-wireless, Pontus Fuchs

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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v2] mac80211: Disallow changing chan type on monitor when CHAN_MODE_FIXED
  2012-06-12 12:13 [PATCH v2] mac80211: Disallow changing chan type on monitor when CHAN_MODE_FIXED Pontus Fuchs
@ 2012-06-13  8:23 ` Johannes Berg
  0 siblings, 0 replies; 2+ messages in thread
From: Johannes Berg @ 2012-06-13  8:23 UTC (permalink / raw)
  To: Pontus Fuchs; +Cc: linville, linux-wireless

On Tue, 2012-06-12 at 14:13 +0200, Pontus Fuchs wrote:
> 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.

Applied, I fixed the typo (parallel) and replaced !netdev with !sdata to
match the other line of code.

johannes



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-06-13  8:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-12 12:13 [PATCH v2] mac80211: Disallow changing chan type on monitor when CHAN_MODE_FIXED Pontus Fuchs
2012-06-13  8:23 ` Johannes Berg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).