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
This commit is contained in:
Kajetan Staszkiewicz 2025-03-03 11:43:21 +01:00
parent 7e51bc6cdd
commit 2624ba37e6

View file

@ -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,