diff options
author | Bala Shanmugam <bkamatch@qca.qualcomm.com> | 2012-04-20 09:42:58 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-04-23 15:37:41 -0400 |
commit | 218d2e26dceb241e4b253c5c4702ee1b38b715cc (patch) | |
tree | 3ae9e3da50fc6ed24ab12c2c6ea7d1e2516bef08 /net/wireless | |
parent | 0d8a0a17288e419c2e5e9ce18c8b66b390eb7e23 (diff) |
cfg80211: Validate legacy rateset.
Legacy rates are not validated while configuring
tx rateset using iw. So below cmd is accepted by nl80211.
sudo iw wlan2 set bitrates legacy-2.4 1 2 3
Validate legacy rates and return
error if any rate in the rateset is not valid.
Signed-off-by: Bala Shanmugam <bkamatch@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/wireless')
-rw-r--r-- | net/wireless/nl80211.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index bcf6f70e518d..140c1d291d4e 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c | |||
@@ -5577,6 +5577,9 @@ static int nl80211_set_tx_bitrate_mask(struct sk_buff *skb, | |||
5577 | sband, | 5577 | sband, |
5578 | nla_data(tb[NL80211_TXRATE_LEGACY]), | 5578 | nla_data(tb[NL80211_TXRATE_LEGACY]), |
5579 | nla_len(tb[NL80211_TXRATE_LEGACY])); | 5579 | nla_len(tb[NL80211_TXRATE_LEGACY])); |
5580 | if ((mask.control[band].legacy == 0) && | ||
5581 | nla_len(tb[NL80211_TXRATE_LEGACY])) | ||
5582 | return -EINVAL; | ||
5580 | } | 5583 | } |
5581 | if (tb[NL80211_TXRATE_MCS]) { | 5584 | if (tb[NL80211_TXRATE_MCS]) { |
5582 | if (!ht_rateset_to_mask( | 5585 | if (!ht_rateset_to_mask( |