From ff7e403f065d1dd45fe5c83f1513fbc452fac41f Mon Sep 17 00:00:00 2001 From: peterhuang Date: Wed, 18 Aug 2021 18:57:28 +0800 Subject: [PATCH] Fix channel switch wrapper when switching from HT to VHT/HE 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 --- src/ap/beacon.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/ap/beacon.c b/src/ap/beacon.c index 22782f54e..8cd1c4170 100644 --- a/src/ap/beacon.c +++ b/src/ap/beacon.c @@ -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);