mac80211: fix DTIM setting
authorJohannes Berg <johannes@sipsolutions.net>
Thu, 17 Sep 2009 17:19:23 +0000 (10:19 -0700)
committerJohn W. Linville <linville@tuxdriver.com>
Wed, 23 Sep 2009 15:35:53 +0000 (11:35 -0400)
commit6a211bf1fc63891bfbc510d9caa751c4dee4bc37
tree9f243de62a131b59520c0bf592332f73a2f93a99
parentfe9f6342c86292aee1941447f22dc5470735e5a1
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>
net/mac80211/scan.c