Search Linux Wireless

[PATCH 1/4] cfg80211: check allowed channel max bandwidth before setting HT40

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Luis R. Rodriguez <lrodriguez@xxxxxxxxxxx>
---
 net/wireless/nl80211.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 531bb67..08d4f55 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -398,6 +398,12 @@ static int nl80211_set_wiphy(struct sk_buff *skb, struct genl_info *info)
 		/* Primary channel not allowed */
 		if (!chan || chan->flags & IEEE80211_CHAN_DISABLED)
 			goto bad_res;
+		/* You need 40 MHz for an HT40 channel */
+		if (channel_type == NL80211_CHAN_HT40PLUS ||
+		    channel_type == NL80211_CHAN_HT40MINUS) {
+			if (chan->max_bandwidth < 40)
+				goto bad_res;
+		}
 
 		if (channel_type == NL80211_CHAN_HT40MINUS)
 			sec_freq = freq - 20;
-- 
1.6.0.6

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux