From bcaa1ea0848d7f2f48a29294b4427f99ced62832 Mon Sep 17 00:00:00 2001 From: Hu Wang Date: Thu, 30 Sep 2021 12:07:24 +0530 Subject: [PATCH] HE: Disable HE in hostapd_set_freq_params() if driver does not support 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 --- src/common/hw_features_common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/hw_features_common.c b/src/common/hw_features_common.c index 8a897fddc..e7ac3b2aa 100644 --- a/src/common/hw_features_common.c +++ b/src/common/hw_features_common.c @@ -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; -- 2.47.2