From: Shayne Chen Date: Thu, 5 Sep 2024 05:55:28 +0000 (+0800) Subject: hostapd: Fix length of Bandwidth Indication subelement X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=982c634accb1c9890902622a0bc82742f69909a6;p=thirdparty%2Fhostap.git hostapd: Fix length of Bandwidth Indication subelement 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 Signed-off-by: Allen Ye --- diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c index 00fd5e4bf..35e3e710c 100644 --- a/src/ap/ieee802_11.c +++ b/src/ap/ieee802_11.c @@ -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;