Skip to content

Commit

Permalink
mac80211_hwsim: fix beacon delta calculation
Browse files Browse the repository at this point in the history
Due to the cast from uint32_t to int64_t, a wrong next beacon timing is
calculated and effectively the beacon timer stops working. This is
especially bad for 802.11s mesh networks, because discovery breaks
without beacons.

Signed-off-by: Benjamin Beichler <benjamin.beichler@uni-rostock.de>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
  • Loading branch information
Benjamin Beichler authored and Johannes Berg committed Nov 15, 2016
1 parent a786f96 commit 4fb7f8a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/wireless/mac80211_hwsim.c
Original file line number Diff line number Diff line change
Expand Up @@ -826,7 +826,7 @@ static void mac80211_hwsim_set_tsf(struct ieee80211_hw *hw,
data->bcn_delta = do_div(delta, bcn_int);
} else {
data->tsf_offset -= delta;
data->bcn_delta = -do_div(delta, bcn_int);
data->bcn_delta = -(s64)do_div(delta, bcn_int);
}
}

Expand Down

0 comments on commit 4fb7f8a

Please sign in to comment.