HomeFreeBSD

pfctl: fix recursive printing of NAT rules

Description

pfctl: fix recursive printing of NAT rules

pfctl_show_nat() is called recursively to print nat anchors. This passes the
anchor path, but this path was modified by pfctl_show_nat(), leading to issues
printing the anchors.

Make a copy of the path ('npath') before we modify it. Ensure we do this
correctly by sprinking in 'const', and add a test case to verify that we do now
print things correctly.

Reported by: Thomas Pasqualini <thomas.pasqualini@orange.com>
MFC after: 2 weeks
Sponsored by: Rubicon Communications, LLC ("Netgate")

(cherry picked from commit 58164dcb55d62ca73b5e550b8344bf61e2d8a47a)

Details

Provenance
kpAuthored on Wed, Apr 2, 4:04 PM
Parents
rGf852f4f7b6f1: EC2: Set PCIe eject timeout to 0
Branches
Unknown
Tags
Unknown