git: 1594fbd7f2f4 - main - pfctl: Report the error of a failed fingerprint flush

From: R. Christian McDonald <rcm_at_FreeBSD.org>
Date: Mon, 19 Oct 2026 19:15:33 UTC
The branch main has been updated by rcm:

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

commit 1594fbd7f2f4c1af3262d1abd8cb100be2fed414
Author:     R. Christian McDonald <rcm@FreeBSD.org>
AuthorDate: 2026-10-19 18:44:09 +0000
Commit:     R. Christian McDonald <rcm@FreeBSD.org>
CommitDate: 2026-10-19 19:14:04 +0000

    pfctl: Report the error of a failed fingerprint flush
    
    pfctl_flush_fingerprints() returns an error number instead of setting
    errno, so a failed flush was reported with whatever errno held: "No
    error: 0" on a kernel with ALTQ, ENODEV from the ALTQ probe on one
    without.  Every "pfctl -f" flushes the fingerprints first, so on a
    kernel that predates PFNL_CMD_OSFP_FLUSH every ruleset load fails this
    way without saying why.
    
    Reviewed by:    kp
    Fixes:          75c0a8376204 ("pf: convert DIOCOSFPFLUSH DIOCOSFPGET DIOCOSFPADD to netlink")
    Sponsored by:   Rubicon Communications, LLC ("Netgate")
---
 sbin/pfctl/pfctl_osfp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sbin/pfctl/pfctl_osfp.c b/sbin/pfctl/pfctl_osfp.c
index b1c1908cb3fc..943b86752e72 100644
--- a/sbin/pfctl/pfctl_osfp.c
+++ b/sbin/pfctl/pfctl_osfp.c
@@ -263,7 +263,7 @@ pfctl_file_fingerprints(int dev, int opts, const char *fp_filename)
 void
 pfctl_clear_fingerprints(int dev, int opts)
 {
-	if (pfctl_flush_fingerprints(pfh) != 0)
+	if ((errno = pfctl_flush_fingerprints(pfh)) != 0)
 		pfctl_err(opts, 1, "DIOCOSFPFLUSH");
 }