]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Fix HT40 co-ex scan for some pri/sec channel switches
authorJouni Malinen <j@w1.fi>
Sat, 15 Mar 2014 14:42:29 +0000 (16:42 +0200)
committerJouni Malinen <j@w1.fi>
Sat, 15 Mar 2014 17:04:31 +0000 (19:04 +0200)
Secondary channel was compared incorrectly (-4/4 vs. actual channel
number) which broke matching neighboring 40 MHz BSSes and only the
no-beacons-on-secondary-channel rule was applied in practice. Once
sec_chan was fixed, this triggered another issue in this function where
both rules to switch pri/sec channels could end up getting applied in a
way that effectively canceled the switch.

Signed-off-by: Jouni Malinen <j@w1.fi>
src/ap/hw_features.c

index 28e92fd8d9beb74aeb8957eb2d1c3bdeab934248..d319ce007ce35baf5e62b336461ea0d78c72d8d6 100644 (file)
@@ -327,7 +327,7 @@ static int ieee80211n_check_40mhz_5g(struct hostapd_iface *iface,
        int match;
 
        pri_chan = iface->conf->channel;
-       sec_chan = iface->conf->secondary_channel * 4;
+       sec_chan = pri_chan + iface->conf->secondary_channel * 4;
        pri_freq = hostapd_hw_get_freq(iface->bss[0], pri_chan);
        if (iface->conf->secondary_channel > 0)
                sec_freq = pri_freq + 20;
@@ -351,6 +351,7 @@ static int ieee80211n_check_40mhz_5g(struct hostapd_iface *iface,
                           "channel to get secondary channel with no Beacons "
                           "from other BSSes");
                ieee80211n_switch_pri_sec(iface);
+               return 1;
        }
 
        /*