From 9c6b0a941672eb54e5a5e11f4d6a699f2aba1709 Mon Sep 17 00:00:00 2001 From: Lavanya Suresh Date: Thu, 1 Apr 2021 22:55:39 +0530 Subject: [PATCH] hostapd: Disable VHT/HE when WMM is not enabled When WMM is disabled, HT/VHT/HE capabilities should not be used for any STA. If any STA advertises these capabilities, hostapd AP disables HT capabilities in STA flags during STA assoc, but VHT/HE was not handled similarly. This could allow a STA to associate in VHT/HE mode even in WMM disable case. To avoid this, disable VHT/HE capabilities similarly to HT during STA association, if WMM is not enabled by the STA. Signed-off-by: Lavanya Suresh --- src/ap/ieee802_11_he.c | 4 ++-- src/ap/ieee802_11_vht.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ap/ieee802_11_he.c b/src/ap/ieee802_11_he.c index c27bb1fcd..917ed946d 100644 --- a/src/ap/ieee802_11_he.c +++ b/src/ap/ieee802_11_he.c @@ -434,8 +434,8 @@ u16 copy_sta_he_capab(struct hostapd_data *hapd, struct sta_info *sta, enum ieee80211_op_mode opmode, const u8 *he_capab, size_t he_capab_len) { - if (!he_capab || !hapd->iconf->ieee80211ax || - hapd->conf->disable_11ax || + if (!he_capab || !(sta->flags & WLAN_STA_WMM) || + !hapd->iconf->ieee80211ax || hapd->conf->disable_11ax || !check_valid_he_mcs(hapd, he_capab, opmode) || ieee80211_invalid_he_cap_size(he_capab, he_capab_len) || he_capab_len > sizeof(struct ieee80211_he_capabilities)) { diff --git a/src/ap/ieee802_11_vht.c b/src/ap/ieee802_11_vht.c index d0370229c..828f0abb5 100644 --- a/src/ap/ieee802_11_vht.c +++ b/src/ap/ieee802_11_vht.c @@ -171,7 +171,7 @@ u16 copy_sta_vht_capab(struct hostapd_data *hapd, struct sta_info *sta, const u8 *vht_capab) { /* Disable VHT caps for STAs associated to no-VHT BSSes. */ - if (!vht_capab || + if (!vht_capab || !(sta->flags & WLAN_STA_WMM) || !hapd->iconf->ieee80211ac || hapd->conf->disable_11ac || !check_valid_vht_mcs(hapd->iface->current_mode, vht_capab)) { sta->flags &= ~WLAN_STA_VHT;