[PATCH 3/3] AP: check a STA is HE before copying EHT/6GHz capabilities

Pablo Martin-Gomez pmartin-gomez at freebox.fr
Wed Jun 11 11:38:08 PDT 2025


A EHT STA and/or a 6GHz capable STA is a HE STA. If a STA has an
invalid HE capabilities, the HE capability of the STA is
deactivated but the EHT/6GHz capability is still activated and their
elements copied.

Deactivate the EHT/6GHz capability of a STA if it is not a HE STA.

Signed-off-by: Pablo Martin-Gomez <pmartin-gomez at freebox.fr>
---
 src/ap/ieee802_11_eht.c | 3 ++-
 src/ap/ieee802_11_he.c  | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/ap/ieee802_11_eht.c b/src/ap/ieee802_11_eht.c
index fe4d0ce56..b8955ce4f 100644
--- a/src/ap/ieee802_11_eht.c
+++ b/src/ap/ieee802_11_eht.c
@@ -401,7 +401,8 @@ u16 copy_sta_eht_capab(struct hostapd_data *hapd, struct sta_info *sta,
 	    ieee80211_invalid_eht_cap_size(mode, hapd->iconf->op_class,
 					   he_capab, eht_capab,
 					   eht_capab_len) ||
-	    !check_valid_eht_mcs(hapd, eht_capab, opmode)) {
+	    !check_valid_eht_mcs(hapd, eht_capab, opmode) ||
+	    !(sta->flags & WLAN_STA_HE)) {
 		sta->flags &= ~WLAN_STA_EHT;
 		os_free(sta->eht_capab);
 		sta->eht_capab = NULL;
diff --git a/src/ap/ieee802_11_he.c b/src/ap/ieee802_11_he.c
index f4adeada9..69fa4bebb 100644
--- a/src/ap/ieee802_11_he.c
+++ b/src/ap/ieee802_11_he.c
@@ -531,7 +531,8 @@ u16 copy_sta_he_6ghz_capab(struct hostapd_data *hapd, struct sta_info *sta,
 {
 	if (!he_6ghz_capab || !hapd->iconf->ieee80211ax ||
 	    hapd->conf->disable_11ax ||
-	    !is_6ghz_op_class(hapd->iconf->op_class)) {
+	    !is_6ghz_op_class(hapd->iconf->op_class) ||
+	    !(sta->flags & WLAN_STA_HE)) {
 		sta->flags &= ~WLAN_STA_6GHZ;
 		os_free(sta->he_6ghz_capab);
 		sta->he_6ghz_capab = NULL;
-- 
2.43.0




More information about the Hostap mailing list