From: Prasanna JS Date: Fri, 18 Aug 2023 12:31:47 +0000 (-0700) Subject: nl80211: Fix beacon rate configuration for legacy rates 36, 48, 54 Mbps X-Git-Tag: hostap_2_11~1036 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0a6842d5030e43c8d89ffd99f5faa63e053e004f;p=thirdparty%2Fhostap.git nl80211: Fix beacon rate configuration for legacy rates 36, 48, 54 Mbps Typecasting takes precedence over division here, so the legacy rates larger than 255 * 100 kbps (i.e., 36, 48, 54 Mbps) ended up getting truncated to invalid values. Fix this by typecasting the value after the division. Fixes: d4f3003c56f8 ("nl80211: Configure Beacon frame TX rate if driver advertises support") Signed-off-by: Prasanna JS --- diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c index e4180daed..563ce61d7 100644 --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c @@ -4531,7 +4531,7 @@ static int nl80211_put_beacon_rate(struct nl_msg *msg, u64 flags, u64 flags2, } if (nla_put_u8(msg, NL80211_TXRATE_LEGACY, - (u8) params->beacon_rate / 5) || + (u8) (params->beacon_rate / 5)) || nla_put(msg, NL80211_TXRATE_HT, 0, NULL) || (params->freq->vht_enabled && nla_put(msg, NL80211_TXRATE_VHT, sizeof(vht_rate),