[PATCH] nl80211: clear VHT and HE MCS rates in legacy beacon tx rate
Rajkumar Manoharan
rmanohar at codeaurora.org
Sat Oct 3 05:25:08 EDT 2020
While configuring legacy beacon rate, VHT and HE MCS rates must be cleared.
Otherwise the default MCS rates is filled by cfg80211 while validating beacon
tx rate netlink attribute. This issue is exposed by ap_beacon_rate_legacy2
test case while validating HE MCS beacon tx rate support.
Reported-by: Johannes Berg <johannes at sipsolutions.net>
Signed-off-by: Rajkumar Manoharan <rmanohar at codeaurora.org>
---
src/drivers/driver_nl80211.c | 16 ++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)
diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
index 2ee34d11d64e..c435d54b5168 100644
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
@@ -4165,6 +4165,7 @@ static int nl80211_put_beacon_rate(struct nl_msg *msg, const u64 flags,
{
struct nlattr *bands, *band;
struct nl80211_txrate_vht vht_rate;
+ struct nl80211_txrate_he he_rate;
if (!params->freq ||
(params->beacon_rate == 0 &&
@@ -4194,6 +4195,7 @@ static int nl80211_put_beacon_rate(struct nl_msg *msg, const u64 flags,
return -1;
os_memset(&vht_rate, 0, sizeof(vht_rate));
+ os_memset(&he_rate, 0, sizeof(he_rate));
switch (params->rate_type) {
case BEACON_RATE_LEGACY:
@@ -4206,9 +4208,9 @@ static int nl80211_put_beacon_rate(struct nl_msg *msg, const u64 flags,
if (nla_put_u8(msg, NL80211_TXRATE_LEGACY,
(u8) params->beacon_rate / 5) ||
nla_put(msg, NL80211_TXRATE_HT, 0, NULL) ||
- (params->freq->vht_enabled &&
- nla_put(msg, NL80211_TXRATE_VHT, sizeof(vht_rate),
- &vht_rate)))
+ nla_put(msg, NL80211_TXRATE_VHT, sizeof(vht_rate),
+ &vht_rate) ||
+ nla_put(msg, NL80211_TXRATE_HE, sizeof(he_rate), &he_rate))
return -1;
wpa_printf(MSG_DEBUG, " * beacon_rate = legacy:%u (* 100 kbps)",
@@ -4222,9 +4224,9 @@ static int nl80211_put_beacon_rate(struct nl_msg *msg, const u64 flags,
}
if (nla_put(msg, NL80211_TXRATE_LEGACY, 0, NULL) ||
nla_put_u8(msg, NL80211_TXRATE_HT, params->beacon_rate) ||
- (params->freq->vht_enabled &&
- nla_put(msg, NL80211_TXRATE_VHT, sizeof(vht_rate),
- &vht_rate)))
+ nla_put(msg, NL80211_TXRATE_VHT, sizeof(vht_rate),
+ &vht_rate) ||
+ nla_put(msg, NL80211_TXRATE_HE, sizeof(he_rate), &he_rate))
return -1;
wpa_printf(MSG_DEBUG, " * beacon_rate = HT-MCS %u",
params->beacon_rate);
@@ -4243,6 +4245,8 @@ static int nl80211_put_beacon_rate(struct nl_msg *msg, const u64 flags,
if (nla_put(msg, NL80211_TXRATE_VHT, sizeof(vht_rate),
&vht_rate))
return -1;
+ if (nla_put(msg, NL80211_TXRATE_HE, sizeof(he_rate), &he_rate))
+ return -1;
wpa_printf(MSG_DEBUG, " * beacon_rate = VHT-MCS %u",
params->beacon_rate);
break;
--
2.7.4
More information about the Hostap
mailing list