mac80211: initialize sta->last_rx in sta_info_alloc
authorFelix Fietkau <nbd@openwrt.org>
Mon, 21 Mar 2011 19:01:00 +0000 (20:01 +0100)
committerBrad Figg <brad.figg@canonical.com>
Wed, 27 Apr 2011 18:40:28 +0000 (11:40 -0700)
BugLink: http://bugs.launchpad.net/bugs/761134

commit 8bc8aecdc5e26cfda12dbd6867af4aa67836da6a upstream.

This field is used to determine the inactivity time. When in AP mode,
hostapd uses it for kicking out inactive clients after a while. Without this
patch, hostapd immediately deauthenticates a new client if it checks the
inactivity time before the client sends its first data frame.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>

net/mac80211/sta_info.c

index c426504..604216e 100644 (file)
@@ -243,6 +243,7 @@ struct sta_info *sta_info_alloc(struct ieee80211_sub_if_data *sdata,
        memcpy(sta->sta.addr, addr, ETH_ALEN);
        sta->local = local;
        sta->sdata = sdata;
+       sta->last_rx = jiffies;
 
        ewma_init(&sta->avg_signal, 1024, 8);