From: Pablo Martin-Gomez Date: Wed, 11 Jun 2025 18:38:08 +0000 (+0200) Subject: AP: Check a STA is HE before copying EHT/6 GHz capabilities X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e59787a1cb08a53e0f08c131b24f424dd31f1a51;p=thirdparty%2Fhostap.git AP: Check a STA is HE before copying EHT/6 GHz capabilities A EHT STA and/or a 6 GHz 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/6 GHz capability is still activated and their elements copied. Deactivate the EHT/6 GHz capability of a STA if it is not a HE STA. Signed-off-by: Pablo Martin-Gomez --- diff --git a/src/ap/ieee802_11_eht.c b/src/ap/ieee802_11_eht.c index 243e50b9f..ac36c9c48 100644 --- a/src/ap/ieee802_11_eht.c +++ b/src/ap/ieee802_11_eht.c @@ -382,7 +382,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 e072fb831..01bcd75cf 100644 --- a/src/ap/ieee802_11_he.c +++ b/src/ap/ieee802_11_he.c @@ -500,7 +500,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;