Commit 6a211bf1 authored by Johannes Berg's avatar Johannes Berg Committed by John W. Linville

mac80211: fix DTIM setting

When the DTIM setting is read from beacons, mac80211 will
assume it is 1 if the TIM IE is not present or the value
is 0. This sounds fine, but the same function processes
probe responses as well, which don't have a TIM IE. This
leads to overwriting any values previously parsed out of
beacon frames.

Thus, instead of checking for the presence of the TIM IE
when setting the default, simply check whether the DTIM
period value is valid already. If the TIM IE is not there
then the value cannot be valid (it is initialised to 0)
and probe responses received after beacons will not lead
to overwriting an already valid value.
Signed-off-by: default avatarJohannes Berg <johannes@sipsolutions.net>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent fe9f6342
...@@ -90,8 +90,8 @@ ieee80211_bss_info_update(struct ieee80211_local *local, ...@@ -90,8 +90,8 @@ ieee80211_bss_info_update(struct ieee80211_local *local,
bss->dtim_period = tim_ie->dtim_period; bss->dtim_period = tim_ie->dtim_period;
} }
/* set default value for buggy APs */ /* set default value for buggy AP/no TIM element */
if (!elems->tim || bss->dtim_period == 0) if (bss->dtim_period == 0)
bss->dtim_period = 1; bss->dtim_period = 1;
bss->supp_rates_len = 0; bss->supp_rates_len = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment