Page MenuHomeFreeBSD

pfctl: fix no nat / no rdr rules
ClosedPublic

Authored by kp on Fri, Apr 4, 4:18 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Apr 12, 1:21 AM
Unknown Object (File)
Fri, Apr 11, 9:25 AM
Unknown Object (File)
Fri, Apr 11, 7:32 AM
Unknown Object (File)
Wed, Apr 9, 10:18 AM
Unknown Object (File)
Tue, Apr 8, 7:31 PM
Unknown Object (File)
Tue, Apr 8, 1:42 PM
Unknown Object (File)
Tue, Apr 8, 12:25 AM
Unknown Object (File)
Sun, Apr 6, 8:20 PM

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.Fri, Apr 4, 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.Wed, Apr 9, 9:51 AM
This revision was automatically updated to reflect the committed changes.