]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
ACS: Allow downgrading to 20 MHz based on OBSS results
authorAloka Dixit <alokad@codeaurora.org>
Thu, 14 May 2020 23:18:38 +0000 (16:18 -0700)
committerJouni Malinen <j@w1.fi>
Mon, 15 Feb 2021 16:16:33 +0000 (18:16 +0200)
When auto channel selection (ACS) is used for HE 40 MHz in the 2.4 GHz
band, AP sets center frequency after finding a 40 MHz channel and then
runs a scan for overlapping BSSes in neighboring channels. Upon OBSS
detection, AP should downgrade to 20 MHz bandwidth.

This was broken because allowed_ht40_channel_pair() returns true in this
case and the steps to reset center frequency are not executed causing
failure to bring interface up.

Fix the condition to allow rollback to 20 MHz.

Signed-off-by: Aloka Dixit <alokad@codeaurora.org>
src/ap/hw_features.c

index 9c02f036fe7e8e37d7205af80ab4c3116d59f945..93d19e0ba419dee9ae6e27510d2b3d8a29dc2207 100644 (file)
@@ -313,7 +313,7 @@ static void ieee80211n_check_scan(struct hostapd_iface *iface)
 {
        struct wpa_scan_results *scan_res;
        int oper40;
-       int res;
+       int res = 0;
 
        /* Check list of neighboring BSSes (from scan) to see whether 40 MHz is
         * allowed per IEEE Std 802.11-2012, 10.15.3.2 */
@@ -349,7 +349,8 @@ static void ieee80211n_check_scan(struct hostapd_iface *iface)
                }
        }
 
-       res = ieee80211n_allowed_ht40_channel_pair(iface);
+       if (iface->conf->secondary_channel)
+               res = ieee80211n_allowed_ht40_channel_pair(iface);
        if (!res) {
                iface->conf->secondary_channel = 0;
                hostapd_set_oper_centr_freq_seg0_idx(iface->conf, 0);