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
Unknown Object (File)
Tue, Apr 7, 4:30 AM
Unknown Object (File)
Mon, Mar 23, 3:21 PM
Unknown Object (File)
Mon, Mar 23, 12:02 AM
Unknown Object (File)
Feb 28 2026, 1:35 AM
Unknown Object (File)
Feb 1 2026, 7:33 PM
Unknown Object (File)
Feb 1 2026, 9:35 AM
Unknown Object (File)
Feb 1 2026, 9:12 AM
Unknown Object (File)
Jan 30 2026, 8:45 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