Skip to contentSkip to conversation

mac80211: Disallow changing chan type on monitor when CHAN_MODE_FIXED

PATCH Applied Pontus Fuchs 2 participants 2 messages Jun 12, 2012 – Jun 13, 2012 mac80211

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 mac80211: Disallow changing chan type on monitor when CHAN_MODE_FIXED

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.

---
 net/mac80211/cfg.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
net/mac80211/cfg.c +2 -1
index 498c94e..a87591b 100644
@@ -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;
Signature · 1 line
1.7.5.4
maintainer Applied
#1 lore raw
Quoted 4 lines · 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.

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

johannes