[Bug 291763] pfctl: loginterface packet counts for pass/block swapped; byte counts all 0
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 10 Feb 2026 14:59:47 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=291763
--- Comment #7 from eborisch+FreeBSD@gmail.com ---
> It's also interesting to look at pfi_update_status(), where pcounters is
> populated, which also treats it as a 2 * 2 * 2 array.
In 15, with the definition of pf_status.pcounters[2][2][3], the
pfi_update_status() code extracts out the [2][2][2] lower sub-array by indexing
[i][j][k] with the loop.
In contrast, 'pfctl -s info' hits pf_handle_get_status(), which _casts
pf_status.pcounters[2][2][3] to a pointer_ and copies the first 8 elements into
its output. This should work on main with the right-sized pf_status.pcounters,
but leads downstream to the incorrect output from ‘pfctl -s info’ (with 'set
loginterface ifname') on 15.
If the resize to pf_status.pcounters[2][2][2] lands in 15 / 15.0, we should be
set. If the desire is to not resize the kernel structure within stable/15, then
pf_handle_get_status() needs an [i][j][k] extraction loop like
pfi_update_status(). I can create a patch with those changes and push it up to
GitHub, if you like.
15.0-p2:
# pfctl -s info
Status: Enabled for 4 days 12:54:12 Debug: Urgent
Interface Stats for vtnet0 IPv4 IPv6
Bytes In 0 0 # Stays zero
Bytes Out 0 0 # Stays zero
Packets In
Passed 8979115 24 # Correct
Blocked 20600 0 # Correct
Packets Out
Passed 0 0 # Stays zero
Blocked 6507902 0 # Actually Passed
Out
vs. 14.3 on a sibling system:
# pfctl -s info
Status: Enabled for 6 days 04:51:56 Debug: Urgent
Interface Stats for vmx0 IPv4 IPv6
Bytes In 89609864859 0
Bytes Out 89429385267 0
Packets In
Passed 116945513 0
Blocked 1061014 0
Packets Out
Passed 93152637 0
Blocked 629 0
--
You are receiving this mail because:
You are the assignee for the bug.