From 38ded68a3828ebb6c001d2fe57ee7da9c6a7ff6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alvin=20=C5=A0ipraga?= Date: Sat, 22 May 2021 12:06:25 +0000 Subject: [PATCH] scan: parse NL80211_BSS_LAST_SEEN_BOOTTIME in units of nanoseconds NL80211_BSS_LAST_SEEN_BOOTTIME is expressed in nanoseconds, while BSS timestamps are expressed in microseconds internally. Convert the attribute to microseconds when using it to timestamp a BSS. This makes iwd expire absent BSSes within 30 seconds as intended. Fixes: 454cee12d473 ("scan: Use kernel-reported time-stamp if provided") --- src/scan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/scan.c b/src/scan.c index a6f97c08..8967706f 100644 --- a/src/scan.c +++ b/src/scan.c @@ -1231,7 +1231,7 @@ static struct scan_bss *scan_parse_attr_bss(struct l_genl_attr *attr, if (L_WARN_ON(len != sizeof(uint64_t))) break; - bss->time_stamp = l_get_u64(data); + bss->time_stamp = l_get_u64(data) / L_NSEC_PER_USEC; break; } }