git: e224b9b867f4 - stable/15 - pfctl: always warn if a duplicate rule was detected

From: Kristof Provost <kp_at_FreeBSD.org>
Date: Wed, 25 Mar 2026 10:54:01 UTC
The branch stable/15 has been updated by kp:

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

commit e224b9b867f4e7de959afaa63d56672e13d7c454
Author:     Kristof Provost <kp@FreeBSD.org>
AuthorDate: 2026-03-12 14:24:42 +0000
Commit:     Kristof Provost <kp@FreeBSD.org>
CommitDate: 2026-03-25 07:11:58 +0000

    pfctl: always warn if a duplicate rule was detected
    
    MFC after:      1 week
    Sponsored by:   Rubicon Communications, LLC ("Netgate")
    
    (cherry picked from commit 66d66dd0f6f83926980fc1d68dd366c0057350c5)
---
 sbin/pfctl/pfctl.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sbin/pfctl/pfctl.c b/sbin/pfctl/pfctl.c
index a9839304d0c7..7865467f2ea8 100644
--- a/sbin/pfctl/pfctl.c
+++ b/sbin/pfctl/pfctl.c
@@ -2189,13 +2189,13 @@ pfctl_load_rule(struct pfctl *pf, char *path, struct pfctl_rule *r, int depth)
 		}
 	}
 
-	if (pf->opts & PF_OPT_VERBOSE) {
+	if (pf->opts & PF_OPT_VERBOSE || was_present) {
 		INDENT(depth, !(pf->opts & PF_OPT_VERBOSE2));
 		print_rule(r, name,
 		    pf->opts & PF_OPT_VERBOSE2,
 		    pf->opts & PF_OPT_NUMERIC);
 		if (was_present)
-			printf(" -- rule was already present");
+			printf(" -- rule was already present\n");
 	}
 	path[len] = '\0';
 	pfctl_clear_pool(&r->rdr);