aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKristof Provost <kp@FreeBSD.org>2024-12-12 12:50:24 +0000
committerKristof Provost <kp@FreeBSD.org>2024-12-17 10:07:18 +0000
commit706b42cc4bd9a255ed920b1a4095856f8df9e52c (patch)
tree15e41b151e3fde64677e91aac81f680d68546e56
parent08a512019ccb19d1e05d4069faa959a530256ec1 (diff)
pf: give the correct address family to dummynet after nat64
Pass the new address family rather than the incoming one. In most (i.e. all but nat64) that's the same, but for nat64 we want the new address family instead. Sponsored by: Rubicon Communications, LLC ("Netgate")
-rw-r--r--sys/netpfil/pf/pf.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c
index d9c0beb0169f..9128562fd71c 100644
--- a/sys/netpfil/pf/pf.c
+++ b/sys/netpfil/pf/pf.c
@@ -9381,7 +9381,7 @@ pf_pdesc_to_dnflow(const struct pf_pdesc *pd, const struct pf_krule *r,
dnflow->f_id.proto = pd->proto;
dnflow->f_id.extra = dnflow->rule.info;
- switch (pd->af) {
+ switch (pd->naf) {
case AF_INET:
dnflow->f_id.addr_type = 4;
dnflow->f_id.src_ip = ntohl(pd->src->v4.s_addr);
@@ -9490,7 +9490,7 @@ pf_dummynet_route(struct pf_pdesc *pd, struct pf_kstate *s,
MPASS(sa != NULL);
- switch (pd->af) {
+ switch (pd->naf) {
case AF_INET:
memcpy(&pd->pf_mtag->dst, sa,
sizeof(struct sockaddr_in));