diff options
author | Johannes Berg <johannes@sipsolutions.net> | 2009-09-17 19:19:23 +0200 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-09-23 17:35:53 +0200 |
commit | 6a211bf1fc63891bfbc510d9caa751c4dee4bc37 (patch) | |
tree | 9f243de62a131b59520c0bf592332f73a2f93a99 /net/mac80211 | |
parent | ar9170usb: add usbid for TP-Link TL-WN821N v2 (diff) | |
download | linux-6a211bf1fc63891bfbc510d9caa751c4dee4bc37.tar.xz linux-6a211bf1fc63891bfbc510d9caa751c4dee4bc37.zip |
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: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211')
-rw-r--r-- | net/mac80211/scan.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/net/mac80211/scan.c b/net/mac80211/scan.c index 039901109fa1..71e10cabf811 100644 --- a/net/mac80211/scan.c +++ b/net/mac80211/scan.c @@ -90,8 +90,8 @@ ieee80211_bss_info_update(struct ieee80211_local *local, bss->dtim_period = tim_ie->dtim_period; } - /* set default value for buggy APs */ - if (!elems->tim || bss->dtim_period == 0) + /* set default value for buggy AP/no TIM element */ + if (bss->dtim_period == 0) bss->dtim_period = 1; bss->supp_rates_len = 0; |