Page MenuHomeFreeBSD

pfctl: fix no nat / no rdr rules
ClosedPublic

Authored by kp on Apr 4 2025, 4:18 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Sep 26, 2:30 PM
Unknown Object (File)
Wed, Sep 24, 3:26 AM
Unknown Object (File)
Sep 16 2025, 5:30 AM
Unknown Object (File)
Sep 15 2025, 6:42 AM
Unknown Object (File)
Sep 15 2025, 3:27 AM
Unknown Object (File)
Sep 10 2025, 11:31 AM
Unknown Object (File)
Sep 8 2025, 3:57 AM
Unknown Object (File)
Sep 1 2025, 6:09 AM

Details

Summary

In aeddee83341 the nat rule parsing was significantly reworked, unintentionally
breaking no nat / no rdr rules. The option to not have a -> ... redirspec was
omitted.

Add trivial test cases to catch such issues in the future.

Reported by: Thomas Pasqualini <thomas.pasqualini@orange.com>
Sponsored by: Orange Business Services

Diff Detail

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

Event Timeline

kp requested review of this revision.Apr 4 2025, 4:18 PM
sbin/pfctl/tests/pfctl_test_list.inc
177

This does not really describe what is tested. Maybe something like "no {nat,rdr} rules have no ARROW port_redirspec"?

sbin/pfctl/tests/pfctl_test_list.inc
177

I'd argue that it does describe the test, in that we're ensuring that 'no nat' or 'no rdr' rules can be set.
Yes, they don't include ARROW port_redirspec, but that's only part of what needs to be correct.
(We can't have ARROW port_redirspec, or the validation code objects, and without this patch the parser objects if the ARROW port_redirspec isn't present.)

177

I'm not entirely sure how to describe all of that in a one line test description.

This revision was not accepted when it landed; it landed in state Needs Review.Apr 9 2025, 9:51 AM
This revision was automatically updated to reflect the committed changes.