]> git.baikalelectronics.ru Git - kernel.git/commit
mac80211: fix station inactive_time shortly after boot
authorAhmed Zaki <anzaki@gmail.com>
Thu, 31 Oct 2019 12:12:43 +0000 (06:12 -0600)
committerJohannes Berg <johannes.berg@intel.com>
Fri, 8 Nov 2019 08:17:28 +0000 (09:17 +0100)
commit887512ceaae1bd383c0c188b2a146a9e348d85e0
treecb3c05420787cef15b264b35b6b8ea6936f181e3
parent81a72c22e941e6c92835b9769abbf07c6212b8c3
mac80211: fix station inactive_time shortly after boot

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>
net/mac80211/sta_info.c