From 07525cd5e2e942507db8913f8f20d5adc1e9bff7 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Thu, 14 Dec 2023 20:59:42 +0200 Subject: [PATCH] Fix HE enabling for IBSS and mesh Earlier refactoring of ibss_mesh_setup_freq() ended up dropping the case where HE would be enabled without VHT on the 2.4 GHz band. Add that back to allow HE to be used on 2.4 GHz with IBSS and mesh. Fixes: 64043e6156af ("Split ibss_mesh_setup_freq() into multiple functions") Signed-off-by: Jouni Malinen --- wpa_supplicant/wpa_supplicant.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c index ade4d003a..139525cb1 100644 --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c @@ -3072,7 +3072,7 @@ void ibss_mesh_setup_freq(struct wpa_supplicant *wpa_s, struct hostapd_hw_modes *mode = NULL; int i, obss_scan = 1; u8 channel; - bool is_6ghz; + bool is_6ghz, is_24ghz; freq->freq = ssid->frequency; @@ -3101,6 +3101,9 @@ void ibss_mesh_setup_freq(struct wpa_supplicant *wpa_s, if (!mode) return; + is_24ghz = hw_mode == HOSTAPD_MODE_IEEE80211G || + hw_mode == HOSTAPD_MODE_IEEE80211B; + is_6ghz = is_6ghz_freq(freq->freq); freq->ht_enabled = 0; @@ -3112,7 +3115,7 @@ void ibss_mesh_setup_freq(struct wpa_supplicant *wpa_s, freq->ht_enabled = ibss_mesh_can_use_ht(wpa_s, ssid, mode); if (freq->ht_enabled) freq->vht_enabled = ibss_mesh_can_use_vht(wpa_s, ssid, mode); - if (freq->vht_enabled || is_6ghz) + if (freq->vht_enabled || (freq->ht_enabled && is_24ghz) || is_6ghz) freq->he_enabled = ibss_mesh_can_use_he(wpa_s, ssid, mode, ieee80211_mode); freq->channel = channel; -- 2.47.3