git: 50ecaf1bd46a - main - pf: use AF_INET6 when comparing IPv6 addresses

From: Kristof Provost <kp_at_FreeBSD.org>
Date: Mon, 16 Sep 2024 13:05:21 UTC
The branch main has been updated by kp:

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

commit 50ecaf1bd46a834c4fdaf483eb39df7bb62501e3
Author:     Kristof Provost <kp@FreeBSD.org>
AuthorDate: 2024-08-28 13:40:42 +0000
Commit:     Kristof Provost <kp@FreeBSD.org>
CommitDate: 2024-09-16 11:46:14 +0000

    pf: use AF_INET6 when comparing IPv6 addresses
    
    Reviewed by:    zlei
    MFC after:      1 week
    Obtained from:  OpenBSD, henning <henning@openbsd.org>, cf7c0bf78a
    Sponsored by:   Rubicon Communications, LLC ("Netgate")
    Differential Revision:  https://reviews.freebsd.org/D46576
---
 sys/netpfil/pf/pf.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c
index cb404b93946e..d675c5381e8a 100644
--- a/sys/netpfil/pf/pf.c
+++ b/sys/netpfil/pf/pf.c
@@ -7648,10 +7648,10 @@ pf_test_state_other(struct pf_kstate **state, struct pfi_kkif *kif,
 #endif /* INET */
 #ifdef INET6
 		case AF_INET6:
-			if (PF_ANEQ(pd->src, &nk->addr[pd->sidx], AF_INET))
+			if (PF_ANEQ(pd->src, &nk->addr[pd->sidx], AF_INET6))
 				PF_ACPY(pd->src, &nk->addr[pd->sidx], pd->af);
 
-			if (PF_ANEQ(pd->dst, &nk->addr[pd->didx], AF_INET))
+			if (PF_ANEQ(pd->dst, &nk->addr[pd->didx], AF_INET6))
 				PF_ACPY(pd->dst, &nk->addr[pd->didx], pd->af);
 #endif /* INET6 */
 		}