aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKristof Provost <kp@FreeBSD.org>2026-05-21 11:31:11 +0000
committerKristof Provost <kp@FreeBSD.org>2026-06-11 20:21:57 +0000
commita9ebef44a473b1262abad53a22855317c9406948 (patch)
treea3c2f97d1d0fb60409731bbb333cbb10c189a966
parent314c85574ae08eea6499380556decfcda3e0f49c (diff)
pf: switch to getmicro(up)time()
It is reported that micro(up)time() performs poorly in certain virtualisation scenarios. Absolute accuracy isn't required here, so switch to the slightly less accurate (as per the man page) get-variants. PR: 295043 MFC after: 3 weeks Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit e4130ac13d2fe9c17b8f8e86d39a7b5223fe7b79)
-rw-r--r--sys/net/pfvar.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/net/pfvar.h b/sys/net/pfvar.h
index 9e0917b501e7..2ac61b2fc308 100644
--- a/sys/net/pfvar.h
+++ b/sys/net/pfvar.h
@@ -2403,7 +2403,7 @@ static __inline uint64_t
pf_get_uptime(void)
{
struct timeval t;
- microuptime(&t);
+ getmicrouptime(&t);
return ((t.tv_sec * 1000) + (t.tv_usec / 1000));
}
@@ -2411,7 +2411,7 @@ static __inline uint64_t
pf_get_time(void)
{
struct timeval t;
- microtime(&t);
+ getmicrotime(&t);
return ((t.tv_sec * 1000) + (t.tv_usec / 1000));
}