git: 9503043f6e64 - main - pf: stop using PFIL_FWD

From: Mateusz Guzik <mjg_at_FreeBSD.org>
Date: Mon, 05 Sep 2022 13:06:19 UTC
The branch main has been updated by mjg:

URL: https://cgit.FreeBSD.org/src/commit/?id=9503043f6e64a92d3c35cd8aa932727685378ad0

commit 9503043f6e64a92d3c35cd8aa932727685378ad0
Author:     Mateusz Guzik <mjg@FreeBSD.org>
AuthorDate: 2022-09-02 16:36:52 +0000
Commit:     Mateusz Guzik <mjg@FreeBSD.org>
CommitDate: 2022-09-05 13:06:12 +0000

    pf: stop using PFIL_FWD
    
    It is only there to check if the packet was reassembled,
    relevant if we are forwarding. But if the packet originated
    locally it could not have been reassembled, thus the flag is
    redundant.
    
    Reviewed by:    kp
    Sponsored by:   Rubicon Communications, LLC ("Netgate")
---
 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 e2f8b428fb14..b46c16659ddb 100644
--- a/sys/netpfil/pf/pf.c
+++ b/sys/netpfil/pf/pf.c
@@ -6633,7 +6633,7 @@ pf_route6(struct mbuf **m, struct pf_krule *r, int dir, struct ifnet *oifp,
 		goto bad;
 
 	if (dir == PF_IN) {
-		if (pf_test6(PF_OUT, PFIL_FWD, ifp, &m0, inp) != PF_PASS)
+		if (pf_test6(PF_OUT, 0, ifp, &m0, inp) != PF_PASS)
 			goto bad;
 		else if (m0 == NULL)
 			goto done;
@@ -7929,7 +7929,7 @@ done:
 		PF_STATE_UNLOCK(s);
 
 	/* If reassembled packet passed, create new fragments. */
-	if (action == PF_PASS && *m0 && (pflags & PFIL_FWD) &&
+	if (action == PF_PASS && *m0 && dir == PF_OUT &&
 	    (mtag = m_tag_find(m, PF_REASSEMBLED, NULL)) != NULL)
 		action = pf_refragment6(ifp, m0, mtag);