Page MenuHomeFreeBSD

libpfctl: fix creatorid endianness
ClosedPublic

Authored by kp on Jan 21 2022, 5:36 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Jul 15, 5:40 AM
Unknown Object (File)
Wed, Jul 15, 5:40 AM
Unknown Object (File)
Sun, Jul 5, 4:33 AM
Unknown Object (File)
Sun, Jul 5, 12:22 AM
Unknown Object (File)
Tue, Jun 30, 3:35 AM
Unknown Object (File)
Jun 29 2026, 12:24 PM
Unknown Object (File)
Jun 19 2026, 10:30 PM
Unknown Object (File)
Jun 1 2026, 6:17 PM

Details

Summary

We provide the hostid (which is the state creatorid) to the kernel as a
big endian number (see pfctl/pfctl.c pfctl_set_hostid()), so convert it
back to system endianness when we get it from the kernel.

This avoids a confusing mismatch between the value the user configures
and the value displayed in the state.

MFC after: 3 weeks
Sponsored by: Rubicon Communications, LLC ("Netgate")

Diff Detail

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