Skip to content

Commit 7a3750f

Browse files
donnaskiezjmberg-intel
authored andcommitted
wifi: mac80211: fix beacon interval calculation overflow
As we are converting from TU to usecs, a beacon interval of 100*1024 usecs will lead to integer wrapping. To fix change to use a u32. Fixes: 057d5f4 ("mac80211: sync dtim_count to TSF") Signed-off-by: Lachlan Hodges <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Johannes Berg <[email protected]>
1 parent 0e7face commit 7a3750f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/mac80211/util.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3884,7 +3884,7 @@ void ieee80211_recalc_dtim(struct ieee80211_local *local,
38843884
{
38853885
u64 tsf = drv_get_tsf(local, sdata);
38863886
u64 dtim_count = 0;
3887-
u16 beacon_int = sdata->vif.bss_conf.beacon_int * 1024;
3887+
u32 beacon_int = sdata->vif.bss_conf.beacon_int * 1024;
38883888
u8 dtim_period = sdata->vif.bss_conf.dtim_period;
38893889
struct ps_data *ps;
38903890
u8 bcns_from_dtim;

0 commit comments

Comments
 (0)