Page MenuHomeFreeBSD

pf: use time_uptime rather than time_seconds
ClosedPublic

Authored by kp on Jun 6 2025, 2:25 PM.
Tags
None
Referenced Files
F175065472: D50722.id156738.diff
Thu, Oct 8, 12:25 AM
Unknown Object (File)
Mon, Oct 5, 3:09 PM
Unknown Object (File)
Wed, Sep 23, 5:56 AM
Unknown Object (File)
Wed, Sep 23, 5:54 AM
Unknown Object (File)
Sep 5 2026, 8:56 AM
Unknown Object (File)
Aug 25 2026, 5:39 PM
Unknown Object (File)
Aug 25 2026, 5:37 PM
Unknown Object (File)
Aug 24 2026, 5:33 PM

Details

Summary

Use time_uptime as value for when pf was enabled instead of time_second. Since
time_second changes depending on the wall- clock time, time_second is not a
reliable source for the status. We can even end up with a negative time delta.
Thus, use the monotonically growing time_uptime and compute the correct wall
clock time when userspace requests the status.

ok bluhm@ mikeb@

Obtained from: OpenBSD, patrick <patrick@openbsd.org>, 63b24bda99
Sponsored by: Rubicon Communications, LLC ("Netgate")

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable