git: 14c9a2dbfbb0 - main - net: retire PFIL_FWD

From: Mateusz Guzik <mjg_at_FreeBSD.org>
Date: Wed, 07 Sep 2022 10:04:53 UTC
The branch main has been updated by mjg:

URL: https://cgit.FreeBSD.org/src/commit/?id=14c9a2dbfbb081c59d091001b7ddf75eef00da07

commit 14c9a2dbfbb081c59d091001b7ddf75eef00da07
Author:     Mateusz Guzik <mjg@FreeBSD.org>
AuthorDate: 2022-09-02 16:37:55 +0000
Commit:     Mateusz Guzik <mjg@FreeBSD.org>
CommitDate: 2022-09-07 10:04:31 +0000

    net: retire PFIL_FWD
    
    It is now unused and not having it allows further clean ups.
    
    Reviewed by:    cy, glebius, kp
    Sponsored by:   Rubicon Communications, LLC ("Netgate")
    Differential Revision:  https://reviews.freebsd.org/D36452
---
 sys/net/pfil.h             | 2 +-
 sys/netinet/ip_fastfwd.c   | 2 +-
 sys/netinet/ip_output.c    | 3 ---
 sys/netinet6/ip6_fastfwd.c | 4 ++--
 sys/netinet6/ip6_forward.c | 4 ++--
 5 files changed, 6 insertions(+), 9 deletions(-)

diff --git a/sys/net/pfil.h b/sys/net/pfil.h
index da045b30c6ed..5caee0e715f9 100644
--- a/sys/net/pfil.h
+++ b/sys/net/pfil.h
@@ -80,7 +80,7 @@ struct pfilioc_link {
 
 #define	PFIL_IN		0x00010000
 #define	PFIL_OUT	0x00020000
-#define	PFIL_FWD	0x00040000
+/* UNUSED		0x00040000 */
 #define	PFIL_DIR(f)	((f) & (PFIL_IN|PFIL_OUT))
 #define	PFIL_MEMPTR	0x00080000
 #define	PFIL_HEADPTR	0x00100000
diff --git a/sys/netinet/ip_fastfwd.c b/sys/netinet/ip_fastfwd.c
index 02a6be78d241..33cd08a0005b 100644
--- a/sys/netinet/ip_fastfwd.c
+++ b/sys/netinet/ip_fastfwd.c
@@ -403,7 +403,7 @@ passin:
 		goto passout;
 
 	if (pfil_run_hooks(V_inet_pfil_head, &m, nh->nh_ifp,
-	    PFIL_OUT | PFIL_FWD, NULL) != PFIL_PASS)
+	    PFIL_OUT, NULL) != PFIL_PASS)
 		goto drop;
 
 	M_ASSERTVALID(m);
diff --git a/sys/netinet/ip_output.c b/sys/netinet/ip_output.c
index a502f50ac4df..db39663e508e 100644
--- a/sys/netinet/ip_output.c
+++ b/sys/netinet/ip_output.c
@@ -117,9 +117,6 @@ ip_output_pfil(struct mbuf **mp, struct ifnet *ifp, int flags,
 	struct ip *ip;
 	int pflags = PFIL_OUT;
 
-	if (flags & IP_FORWARDING)
-		pflags |= PFIL_FWD;
-
 	m = *mp;
 	ip = mtod(m, struct ip *);
 
diff --git a/sys/netinet6/ip6_fastfwd.c b/sys/netinet6/ip6_fastfwd.c
index b6a8af8013c4..34c04f4ec683 100644
--- a/sys/netinet6/ip6_fastfwd.c
+++ b/sys/netinet6/ip6_fastfwd.c
@@ -214,8 +214,8 @@ passin:
 	/*
 	 * Outgoing packet firewall processing.
 	 */
-	if (pfil_run_hooks(V_inet6_pfil_head, &m, nh->nh_ifp, PFIL_OUT |
-	    PFIL_FWD, NULL) != PFIL_PASS)
+	if (pfil_run_hooks(V_inet6_pfil_head, &m, nh->nh_ifp, PFIL_OUT,
+	    NULL) != PFIL_PASS)
 		goto dropout;
 
 	/*
diff --git a/sys/netinet6/ip6_forward.c b/sys/netinet6/ip6_forward.c
index d4306eea416f..03ecaf32b7b5 100644
--- a/sys/netinet6/ip6_forward.c
+++ b/sys/netinet6/ip6_forward.c
@@ -313,8 +313,8 @@ again:
 
 	odst = ip6->ip6_dst;
 	/* Run through list of hooks for forwarded packets. */
-	if (pfil_run_hooks(V_inet6_pfil_head, &m, nh->nh_ifp, PFIL_OUT |
-	    PFIL_FWD, NULL) != PFIL_PASS)
+	if (pfil_run_hooks(V_inet6_pfil_head, &m, nh->nh_ifp, PFIL_OUT,
+	    NULL) != PFIL_PASS)
 		goto freecopy;
 	ip6 = mtod(m, struct ip6_hdr *);