Explorar o código

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>
Pontus Fuchs %!s(int64=13) %!d(string=hai) anos
pai
achega
ac4d82fa01
Modificáronse 1 ficheiros con 2 adicións e 1 borrados
  1. 2 1
      net/mac80211/cfg.c

+ 2 - 1
net/mac80211/cfg.c

@@ -689,7 +689,8 @@ static int ieee80211_set_channel(struct wiphy *wiphy,
 	case CHAN_MODE_HOPPING:
 	case CHAN_MODE_HOPPING:
 		return -EBUSY;
 		return -EBUSY;
 	case CHAN_MODE_FIXED:
 	case CHAN_MODE_FIXED:
-		if (local->oper_channel != chan)
+		if (local->oper_channel != chan ||
+		    (!sdata && local->_oper_channel_type != channel_type))
 			return -EBUSY;
 			return -EBUSY;
 		if (!sdata && local->_oper_channel_type == channel_type)
 		if (!sdata && local->_oper_channel_type == channel_type)
 			return 0;
 			return 0;