From 0059fa5bae6acbc62e3bc5ab6bed84fdf6b6c50e Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Wed, 29 Mar 2023 18:25:37 +0300 Subject: [PATCH] 6 GHz: Fix secondary channel setting center_idx_to_bw_6ghz() does not return the bandwidth in MHz and as such, the check here against 20 (MHz) is never true. The returned value is greater than 0 for the over 20 MHz cases. Fixes: 15742566fd7c ("6 GHz: Fix operating class in Supported Operating Classes element") Signed-off-by: Jouni Malinen --- src/ap/hostapd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c index 141c77f4b..8b3fb404d 100644 --- a/src/ap/hostapd.c +++ b/src/ap/hostapd.c @@ -1765,7 +1765,7 @@ static void hostapd_set_6ghz_sec_chan(struct hostapd_iface *iface) bw = center_idx_to_bw_6ghz(seg0); /* Assign the secondary channel if absent in config for * bandwidths > 20 MHz */ - if (bw > 20 && !iface->conf->secondary_channel) { + if (bw > 0 && !iface->conf->secondary_channel) { if (((iface->conf->channel - 1) / 4) % 2) iface->conf->secondary_channel = -1; else