Page MenuHomeFreeBSD

pfctl: fix no nat / no rdr rules
ClosedPublic

Authored by kp on Apr 4 2025, 4:18 PM.
Tags
None
Referenced Files
F171081566: D49665.id153153.diff
Tue, Sep 8, 2:27 PM
Unknown Object (File)
Mon, Sep 7, 10:06 AM
Unknown Object (File)
Sun, Sep 6, 1:45 PM
Unknown Object (File)
Sat, Sep 5, 9:06 PM
Unknown Object (File)
Sat, Sep 5, 1:28 PM
Unknown Object (File)
Sat, Sep 5, 7:33 AM
Unknown Object (File)
Sat, Sep 5, 5:17 AM
Unknown Object (File)
Sat, Sep 5, 4:13 AM
Subscribers

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 Skipped
Unit
Tests Skipped
Build Status
Buildable 63324
Build 60208: arc lint + arc unit

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.