From 2624ba37e6336febb40ab6317d8e4ea63b60fa44 Mon Sep 17 00:00:00 2001 From: Kajetan Staszkiewicz Date: Mon, 3 Mar 2025 11:43:21 +0100 Subject: [PATCH] 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 bb458bce24f..eb3a0826578 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,