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")

Details

Provenance
kpAuthored on Wed, Apr 2, 4:04 PM
Parents
rG7feee915ace1: depend-cleanup: Handle ctld moving from C to C++
Branches
Unknown
Tags
Unknown