HomeFreeBSD

pfctl: Error out early on bad anchor usage

Description

pfctl: Error out early on bad anchor usage

`pfctl -a foo' would do nothing with the non-existent anchor and exit 0.
This implements behaviour as documented in pfctl(8):

-a anchor
    Apply flags -f, -F, and -s only to the rules in the specified
    anchor.

While here, hoist a duplicate "_" check by using the more mnemonic `mode'.

OK henning sashan

Obtained from: OpenBSD, kn <kn@openbsd.org>, 574cdb686a
Sponsored by: Rubicon Communications, LLC ("Netgate")

Details

Provenance
kpAuthored on Jun 27 2025, 2:21 PM
Parents
rGdd2d7ba6f338: pfctl: Fix function name in error messages by using __func__
Branches
Unknown
Tags
Unknown