]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Fix HE enabling for IBSS and mesh
authorJouni Malinen <quic_jouni@quicinc.com>
Thu, 14 Dec 2023 18:59:42 +0000 (20:59 +0200)
committerJouni Malinen <j@w1.fi>
Thu, 14 Dec 2023 18:59:42 +0000 (20:59 +0200)
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 <quic_jouni@quicinc.com>
wpa_supplicant/wpa_supplicant.c

index ade4d003a98621d6bf12301963ece70ca6550916..139525cb1cf4095666970654d32e409a83abe623 100644 (file)
@@ -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;