Page MenuHomeFreeBSD

pf: Parse the GETSTATES state id as 64 bits
Needs ReviewPublic

Authored by rcm on Fri, Oct 9, 6:20 PM.
Tags
None
Referenced Files
F175373775: D60543.id189274.diff
Sat, Oct 10, 9:26 AM
F175373774: D60543.id.diff
Sat, Oct 10, 9:26 AM
F175372362: D60543.diff
Sat, Oct 10, 9:10 AM
F175357774: D60543.id189274.diff
Sat, Oct 10, 6:35 AM
F175310779: D60543.id189274.diff
Fri, Oct 9, 9:01 PM
F175310747: D60543.id189274.diff
Fri, Oct 9, 9:01 PM
F175309867: D60543.diff
Fri, Oct 9, 8:50 PM

Details

Reviewers
kp
Summary

State ids are 64 bits (a counter stored in network byte order) and the
GETSTATES dump sends PF_ST_ID as a u64, but a GETSTATES request parsed
it as a u32. An id taken from the dump was rejected with EINVAL, and
the 4-byte id the kernel did accept could not name a state on a
little-endian host: the low 32 bits of a stored id are 0 until the
counter passes 2^32, and an id of 0 selects the full dump.

Parse PF_ST_ID as a u64, as the dump sends it.

Fixes: 2cef62886dc7 ("pf: convert state retrieval to netlink")
MFC after: 1 week
Sponsored by: Rubicon Communications, LLC ("Netgate")

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped