]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
hostapd: Fix length of Bandwidth Indication subelement
authorShayne Chen <shayne.chen@mediatek.com>
Thu, 5 Sep 2024 05:55:28 +0000 (13:55 +0800)
committerJouni Malinen <j@w1.fi>
Sat, 21 Dec 2024 09:28:39 +0000 (11:28 +0200)
The default length of the Bandwidth Indication subelement should be
equal to the minimum size of ieee80211_bw_ind_element structure. The
previously used value truncated this subelement by one octet.

Fixes: c7e704bdf9c3 ("hostapd: Add Bandwidth Indication subelement support for channel switch")
Signed-off-by: Shayne Chen <shayne.chen@mediatek.com>
Signed-off-by: Allen Ye <allen.ye@mediatek.com>
src/ap/ieee802_11.c

index 00fd5e4bf6ef258a04e346756b69d31cf8c8873d..35e3e710ca21c7712313ad35b648918f194beb14 100644 (file)
@@ -7431,7 +7431,7 @@ static u8 * hostapd_eid_bw_indication(struct hostapd_data *hapd, u8 *eid,
 {
        u16 punct_bitmap = hostapd_get_punct_bitmap(hapd);
        struct ieee80211_bw_ind_element *bw_ind_elem;
-       size_t elen = 3;
+       size_t elen = 4;
 
        if (hapd->cs_freq_params.bandwidth <= 160 && !punct_bitmap)
                return eid;