All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alvin =?unknown-8bit?q?=C5=A0ipraga?= <ALSI@bang-olufsen.dk>
To: iwd@lists.01.org
Subject: [PATCH] scan: parse NL80211_BSS_LAST_SEEN_BOOTTIME in units of nanoseconds
Date: Sat, 22 May 2021 12:06:25 +0000	[thread overview]
Message-ID: <20210522120621.118459-1-alsi@bang-olufsen.dk> (raw)

[-- 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

             reply	other threads:[~2021-05-22 12:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-22 12:06 Alvin =?unknown-8bit?q?=C5=A0ipraga?= [this message]
2021-05-26 15:21 ` [PATCH] scan: parse NL80211_BSS_LAST_SEEN_BOOTTIME in units of nanoseconds Denis Kenzior

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210522120621.118459-1-alsi@bang-olufsen.dk \
    --to=alsi@bang-olufsen.dk \
    --cc=iwd@lists.01.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.