OSDN Git Service

mac80211: fix station inactive_time shortly after boot
authorAhmed Zaki <anzaki@gmail.com>
Thu, 31 Oct 2019 12:12:43 +0000 (06:12 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 5 Dec 2019 08:19:46 +0000 (09:19 +0100)
commit51a564498cfbe97a631bcd7fb30faf2bb254860e
tree9e3963ce6c70ca17a4424b7cdeeff4241ec785be
parentb707e0da2791c0e8a36c20f81d63fd264a267bf4
mac80211: fix station inactive_time shortly after boot

[ Upstream commit 285531f9e6774e3be71da6673d475ff1a088d675 ]

In the first 5 minutes after boot (time of INITIAL_JIFFIES),
ieee80211_sta_last_active() returns zero if last_ack is zero. This
leads to "inactive time" showing jiffies_to_msecs(jiffies).

 # iw wlan0 station get fc:ec:da:64:a6:dd
 Station fc:ec:da:64:a6:dd (on wlan0)
inactive time: 4294894049 ms
.
.
connected time: 70 seconds

Fix by returning last_rx if last_ack == 0.

Signed-off-by: Ahmed Zaki <anzaki@gmail.com>
Link: https://lore.kernel.org/r/20191031121243.27694-1-anzaki@gmail.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/mac80211/sta_info.c