git: 2624ba37e633 - main - pfctl: Fix printing af-to "to" pool
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 04 Mar 2025 12:16:07 UTC
The branch main has been updated by ks: URL: https://cgit.FreeBSD.org/src/commit/?id=2624ba37e6336febb40ab6317d8e4ea63b60fa44 commit 2624ba37e6336febb40ab6317d8e4ea63b60fa44 Author: Kajetan Staszkiewicz <ks@FreeBSD.org> AuthorDate: 2025-03-03 10:43:21 +0000 Commit: Kajetan Staszkiewicz <ks@FreeBSD.org> CommitDate: 2025-03-04 12:14:07 +0000 pfctl: Fix printing af-to "to" pool We can't depend on pool->cur, that is used only inside of kernel for iterating over members of the pool, it is not filled in during loading of ruleset. Reviewed by: kp Approved by: kp (mentor) Sponsored by: InnoGames GmbH Differential Revision: https://reviews.freebsd.org/D49213 --- sbin/pfctl/pfctl_parser.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sbin/pfctl/pfctl_parser.c b/sbin/pfctl/pfctl_parser.c index bb458bce24fb..eb3a0826578e 100644 --- a/sbin/pfctl/pfctl_parser.c +++ b/sbin/pfctl/pfctl_parser.c @@ -1245,7 +1245,7 @@ print_rule(struct pfctl_rule *r, const char *anchor_call, int verbose, int numer printf(" af-to %s from ", r->naf == AF_INET ? "inet" : "inet6"); print_pool(&r->nat, r->nat.proxy_port[0], r->nat.proxy_port[1], r->naf ? r->naf : r->af, PF_NAT); - if (r->rdr.cur != NULL && !TAILQ_EMPTY(&r->rdr.list)) { + if (!TAILQ_EMPTY(&r->rdr.list)) { printf(" to "); print_pool(&r->rdr, r->rdr.proxy_port[0], r->rdr.proxy_port[1], r->naf ? r->naf : r->af,