From c4bab72d9675df0b4346ce50576730fc4accdc76 Mon Sep 17 00:00:00 2001 From: Qiwei Cai Date: Sun, 19 Jan 2020 10:37:26 +0800 Subject: [PATCH] Use secondary channel provided by ACS for HT40 if valid 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 --- src/ap/hw_features.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/ap/hw_features.c b/src/ap/hw_features.c index ba10752eb..0d856d572 100644 --- a/src/ap/hw_features.c +++ b/src/ap/hw_features.c @@ -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; -- 2.39.2