]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
HE: Disable HE in hostapd_set_freq_params() if driver does not support
authorHu Wang <huw@codeaurora.org>
Thu, 30 Sep 2021 06:37:24 +0000 (12:07 +0530)
committerJouni Malinen <j@w1.fi>
Thu, 7 Oct 2021 20:43:16 +0000 (23:43 +0300)
Existing logic to disable HE in hostapd_set_freq_params() is to check
he_cap != NULL, but this is not correct as he_cap is defined as a stack
member of hostapd_hw_modes which can't be NULL. Add one more check
!he_cap->he_supported to make sure HE can be disabled if the driver not
support it.

This fixes a case where a driver does not support HE, but hostapd.conf
enables HE/HT40 on the 2.4 GHz band and hostapd failed to start with
error '40 MHz channel width is not supported in 2.4 GHz'.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
src/common/hw_features_common.c

index 8a897fddc9461007928cc571e10f49a2684cb9cf..e7ac3b2aac6b8a70f2465a49d704eea82feae283 100644 (file)
@@ -405,7 +405,7 @@ int hostapd_set_freq_params(struct hostapd_freq_params *data,
                            int center_segment1, u32 vht_caps,
                            struct he_capabilities *he_cap)
 {
-       if (!he_cap)
+       if (!he_cap || !he_cap->he_supported)
                he_enabled = 0;
        os_memset(data, 0, sizeof(*data));
        data->mode = mode;