]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Use secondary channel provided by ACS for HT40 if valid
authorQiwei Cai <qcai@codeaurora.org>
Sun, 19 Jan 2020 02:37:26 +0000 (10:37 +0800)
committerJouni Malinen <jouni@codeaurora.org>
Mon, 3 Feb 2020 00:03:32 +0000 (02:03 +0200)
Previously, hostapd ignored the secondary channel provided by ACS if
both HT40+ and HT40- are set in hostapd.conf. This change selects such
channel for HT40 if it's valid, which is more reasonable.

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

index ba10752ebd7e0f2ed718987fcde0eb2720e797a4..0d856d5725e8dbcbc3dc1d4b86f82120f827c16b 100644 (file)
@@ -879,10 +879,11 @@ static int hostapd_is_usable_chans(struct hostapd_iface *iface)
        if (!iface->conf->secondary_channel)
                return 1;
 
+       if (hostapd_is_usable_chan(iface, iface->freq +
+                                  iface->conf->secondary_channel * 20, 0))
+               return 1;
        if (!iface->conf->ht40_plus_minus_allowed)
-               return hostapd_is_usable_chan(
-                       iface,
-                       iface->freq + iface->conf->secondary_channel * 20, 0);
+               return 0;
 
        /* Both HT40+ and HT40- are set, pick a valid secondary channel */
        secondary_freq = iface->freq + 20;