* [PATCH] scan: parse NL80211_BSS_LAST_SEEN_BOOTTIME in units of nanoseconds
@ 2021-05-22 12:06 Alvin =?unknown-8bit?q?=C5=A0ipraga?=
2021-05-26 15:21 ` Denis Kenzior
0 siblings, 1 reply; 2+ messages in thread
From: Alvin =?unknown-8bit?q?=C5=A0ipraga?= @ 2021-05-22 12:06 UTC (permalink / raw)
To: iwd
[-- Attachment #1: Type: text/plain, Size: 741 bytes --]
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.
---
src/scan.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/scan.c b/src/scan.c
index a6f97c08f09b..8967706f35b9 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;
}
}
--
2.31.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] scan: parse NL80211_BSS_LAST_SEEN_BOOTTIME in units of nanoseconds
2021-05-22 12:06 [PATCH] scan: parse NL80211_BSS_LAST_SEEN_BOOTTIME in units of nanoseconds Alvin =?unknown-8bit?q?=C5=A0ipraga?=
@ 2021-05-26 15:21 ` Denis Kenzior
0 siblings, 0 replies; 2+ messages in thread
From: Denis Kenzior @ 2021-05-26 15:21 UTC (permalink / raw)
To: iwd
[-- Attachment #1: Type: text/plain, Size: 529 bytes --]
Hi Alvin,
On 5/22/21 7:06 AM, Alvin Šipraga wrote:
> 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.
> ---
> src/scan.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
Nice catch. My bad for not testing this enough. I added a Fixes: tag and
applied, thanks!
Regards,
-Denis
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-05-26 15:21 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-22 12:06 [PATCH] scan: parse NL80211_BSS_LAST_SEEN_BOOTTIME in units of nanoseconds Alvin =?unknown-8bit?q?=C5=A0ipraga?=
2021-05-26 15:21 ` Denis Kenzior
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.