Page MenuHomeFreeBSD

libpfctl: decode PFR_A_AF into a u8
ClosedPublic

Authored by rcm on Tue, Sep 29, 1:06 AM.
Tags
None
Referenced Files
F173967096: D60110.diff
Tue, Sep 29, 4:57 PM
F173931592: D60110.diff
Tue, Sep 29, 11:13 AM
F173931383: D60110.diff
Tue, Sep 29, 11:10 AM
F173913558: D60110.diff
Tue, Sep 29, 7:51 AM
F173905738: D60110.id187948.diff
Tue, Sep 29, 6:24 AM
F173905604: D60110.id187945.diff
Tue, Sep 29, 6:23 AM
F173905424: D60110.diff
Tue, Sep 29, 6:21 AM
F173883350: D60110.id187945.diff
Tue, Sep 29, 2:43 AM

Details

Summary

The kernel sends PFR_A_AF as a u32, although it is documented and
parsed as a u8, and libpfctl decoded it with snl_attr_get_uint32()
straight into the u8 pfra_af. That overwrote pfra_net, pfra_not and
pfra_fback, and left pfra_af zero on big-endian hosts.

Decode it via a temporary, and accept a u8 as well, so that the
kernel can be corrected later without breaking libpfctl.

Fixes: f27e44e2e3b5 ("pf: convert DIOCRGETADDRS to netlink")
Sponsored by: Rubicon Communications, LLC ("Netgate")

Test Plan

No functional change intended

Diff Detail

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

Event Timeline

rcm requested review of this revision.Tue, Sep 29, 1:06 AM
rcm retitled this revision from pf: return per-address feedback from netlink table test to libpfctl: decode PFR_A_AF into a u8.
rcm edited the summary of this revision. (Show Details)
rcm edited the test plan for this revision. (Show Details)
This revision is now accepted and ready to land.Tue, Sep 29, 5:37 AM
This revision was automatically updated to reflect the committed changes.