]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
6 GHz: Fix secondary channel setting
authorJouni Malinen <quic_jouni@quicinc.com>
Wed, 29 Mar 2023 15:25:37 +0000 (18:25 +0300)
committerJouni Malinen <j@w1.fi>
Wed, 29 Mar 2023 15:25:37 +0000 (18:25 +0300)
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 <quic_jouni@quicinc.com>
src/ap/hostapd.c

index 141c77f4bd183b9ac3410bf69fb3402f17766e7e..8b3fb404d33c4a3e324b96c2f2d0b123319af6bd 100644 (file)
@@ -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