Bug 289994 - pfctl: confusing error message when trying to flush tables in non-existent anchor
Summary: pfctl: confusing error message when trying to flush tables in non-existent an...
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 16.0-CURRENT
Hardware: Any Any
: --- Affects Only Me
Assignee: Kristof Provost
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-10-04 14:05 UTC by Roman Bogorodskiy
Modified: 2025-11-21 17:42 UTC (History)
2 users (show)

See Also:
linimon: mfc-stable15?
linimon: mfc-stable14?


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Roman Bogorodskiy freebsd_committer freebsd_triage 2025-10-04 14:05:07 UTC
Executing a command like that, where the "not/real" does not exist:

tulp# pfctl -a not/real -F all
Ethernet rules cleared
rules cleared
nat cleared
pfctl: Operation not supported by device
tulp# 

It fails half way, and the specific failing entity is Tables:

tulp# pfctl -a not/real -F Tables
pfctl: Operation not supported by device
tulp# 


However, the "show" operation displays a more understandable (in my opinion) error message:

tulp# pfctl -a not/real -s Tables
pfctl: Anchor does not exist.
tulp# 

I wonder if `pfctl -a not/real -F <modifier>` should behave the same, i.e. print that anchor does not exist?
Comment 1 commit-hook freebsd_committer freebsd_triage 2025-10-06 21:36:01 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=b476593519e98c11752a207e7cb121fba5c1961b

commit b476593519e98c11752a207e7cb121fba5c1961b
Author:     Kristof Provost <kp@FreeBSD.org>
AuthorDate: 2025-10-06 15:57:44 +0000
Commit:     Kristof Provost <kp@FreeBSD.org>
CommitDate: 2025-10-06 21:35:30 +0000

    pfctl: check if the anchor exists before we attempt to flush anything from it

    PR:             289994
    Sponsored by:   Rubicon Communications, LLC ("Netgate")

 sbin/pfctl/pfctl.c | 6 ++++++
 1 file changed, 6 insertions(+)
Comment 2 Mark Johnston freebsd_committer freebsd_triage 2025-11-21 16:20:40 UTC
Kristof, do you plan to MFC this change?  If not we can simply close the report.
Comment 3 Kristof Provost freebsd_committer freebsd_triage 2025-11-21 17:42:52 UTC
No plans, no.