]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Fix channel switch wrapper when switching from HT to VHT/HE
authorpeterhuang <peterhuang@realtek.com>
Wed, 18 Aug 2021 10:57:28 +0000 (18:57 +0800)
committerJouni Malinen <j@w1.fi>
Sun, 12 Dec 2021 20:42:59 +0000 (22:42 +0200)
Because ieee80211ac and ieee80211ax were not updated before channel
switch is done, hostapd didn't build the Channel Switch Wrapper element
when it switched from HT to bandwidth more than 40 MHz of VHT/HE. fix
this by allowing hostapd_eid_wb_chsw_wrapper() to determine internally
when the element needs to be added based on the new channel instead of
the old configuration.

Signed-off-by: peterhuang <peterhuang@realtek.com>
src/ap/beacon.c

index 22782f54e48005ead7e51740c0e08b273e5d9b00..8cd1c417043e7aa181ba87a4bb470680b2db44c9 100644 (file)
@@ -570,9 +570,7 @@ static u8 * hostapd_gen_probe_resp(struct hostapd_data *hapd,
                pos = hostapd_eid_txpower_envelope(hapd, pos);
 #endif /* CONFIG_IEEE80211AX */
 
-       if ((hapd->iconf->ieee80211ac && !hapd->conf->disable_11ac) ||
-           (hapd->iconf->ieee80211ax && !hapd->conf->disable_11ax))
-               pos = hostapd_eid_wb_chsw_wrapper(hapd, pos);
+       pos = hostapd_eid_wb_chsw_wrapper(hapd, pos);
 
        pos = hostapd_eid_rnr(hapd, pos, WLAN_FC_STYPE_PROBE_RESP);
        pos = hostapd_eid_fils_indic(hapd, pos, 0);
@@ -1594,9 +1592,7 @@ int ieee802_11_build_ap_params(struct hostapd_data *hapd,
                tailpos = hostapd_eid_txpower_envelope(hapd, tailpos);
 #endif /* CONFIG_IEEE80211AX */
 
-       if ((hapd->iconf->ieee80211ac && !hapd->conf->disable_11ac) ||
-           (hapd->iconf->ieee80211ax && !hapd->conf->disable_11ax))
-               tailpos = hostapd_eid_wb_chsw_wrapper(hapd, tailpos);
+       tailpos = hostapd_eid_wb_chsw_wrapper(hapd, tailpos);
 
        tailpos = hostapd_eid_rnr(hapd, tailpos, WLAN_FC_STYPE_BEACON);
        tailpos = hostapd_eid_fils_indic(hapd, tailpos, 0);