From dda6376b04fc3698d2155dd83e61ea03e78ce5a5 Mon Sep 17 00:00:00 2001 From: Mateusz Guzik Date: Thu, 8 Sep 2022 16:01:00 +0000 Subject: [PATCH] net: employ newly added pfil_mbuf_{in,out} where approriate Reviewed by: glebius Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D36454 --- sys/netinet/ip_fastfwd.c | 6 +++--- sys/netinet/ip_input.c | 2 +- sys/netinet6/ip6_fastfwd.c | 4 ++-- sys/netinet6/ip6_forward.c | 2 +- sys/netinet6/ip6_input.c | 2 +- sys/netinet6/ip6_output.c | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/sys/netinet/ip_fastfwd.c b/sys/netinet/ip_fastfwd.c index 33cd08a0005b..ee97cb4af65a 100644 --- a/sys/netinet/ip_fastfwd.c +++ b/sys/netinet/ip_fastfwd.c @@ -310,7 +310,7 @@ ip_tryforward(struct mbuf *m) if (!PFIL_HOOKED_IN(V_inet_pfil_head)) goto passin; - if (pfil_run_hooks(V_inet_pfil_head, &m, m->m_pkthdr.rcvif, PFIL_IN, + if (pfil_mbuf_in(V_inet_pfil_head, &m, m->m_pkthdr.rcvif, NULL) != PFIL_PASS) goto drop; @@ -402,8 +402,8 @@ ip_tryforward(struct mbuf *m) if (!PFIL_HOOKED_OUT(V_inet_pfil_head)) goto passout; - if (pfil_run_hooks(V_inet_pfil_head, &m, nh->nh_ifp, - PFIL_OUT, NULL) != PFIL_PASS) + if (pfil_mbuf_out(V_inet_pfil_head, &m, nh->nh_ifp, + NULL) != PFIL_PASS) goto drop; M_ASSERTVALID(m); diff --git a/sys/netinet/ip_input.c b/sys/netinet/ip_input.c index ead32d645acf..952b14943780 100644 --- a/sys/netinet/ip_input.c +++ b/sys/netinet/ip_input.c @@ -609,7 +609,7 @@ ip_input(struct mbuf *m) goto passin; odst = ip->ip_dst; - if (pfil_run_hooks(V_inet_pfil_head, &m, ifp, PFIL_IN, NULL) != + if (pfil_mbuf_in(V_inet_pfil_head, &m, ifp, NULL) != PFIL_PASS) return; if (m == NULL) /* consumed by filter */ diff --git a/sys/netinet6/ip6_fastfwd.c b/sys/netinet6/ip6_fastfwd.c index 34c04f4ec683..e1c30629643e 100644 --- a/sys/netinet6/ip6_fastfwd.c +++ b/sys/netinet6/ip6_fastfwd.c @@ -164,7 +164,7 @@ ip6_tryforward(struct mbuf *m) */ if (!PFIL_HOOKED_IN(V_inet6_pfil_head)) goto passin; - if (pfil_run_hooks(V_inet6_pfil_head, &m, rcvif, PFIL_IN, NULL) != + if (pfil_mbuf_in(V_inet6_pfil_head, &m, rcvif, NULL) != PFIL_PASS) goto dropin; /* @@ -214,7 +214,7 @@ ip6_tryforward(struct mbuf *m) /* * Outgoing packet firewall processing. */ - if (pfil_run_hooks(V_inet6_pfil_head, &m, nh->nh_ifp, PFIL_OUT, + if (pfil_mbuf_out(V_inet6_pfil_head, &m, nh->nh_ifp, NULL) != PFIL_PASS) goto dropout; diff --git a/sys/netinet6/ip6_forward.c b/sys/netinet6/ip6_forward.c index 03ecaf32b7b5..5173415afda6 100644 --- a/sys/netinet6/ip6_forward.c +++ b/sys/netinet6/ip6_forward.c @@ -313,7 +313,7 @@ ip6_forward(struct mbuf *m, int srcrt) 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, + if (pfil_mbuf_out(V_inet6_pfil_head, &m, nh->nh_ifp, NULL) != PFIL_PASS) goto freecopy; ip6 = mtod(m, struct ip6_hdr *); diff --git a/sys/netinet6/ip6_input.c b/sys/netinet6/ip6_input.c index 70bacfb2436a..2407050f6905 100644 --- a/sys/netinet6/ip6_input.c +++ b/sys/netinet6/ip6_input.c @@ -731,7 +731,7 @@ ip6_input(struct mbuf *m) goto passin; odst = ip6->ip6_dst; - if (pfil_run_hooks(V_inet6_pfil_head, &m, m->m_pkthdr.rcvif, PFIL_IN, + if (pfil_mbuf_in(V_inet6_pfil_head, &m, m->m_pkthdr.rcvif, NULL) != PFIL_PASS) return; ip6 = mtod(m, struct ip6_hdr *); diff --git a/sys/netinet6/ip6_output.c b/sys/netinet6/ip6_output.c index a1504bfb8da6..617271f96407 100644 --- a/sys/netinet6/ip6_output.c +++ b/sys/netinet6/ip6_output.c @@ -1014,7 +1014,7 @@ ip6_output(struct mbuf *m0, struct ip6_pktopts *opt, odst = ip6->ip6_dst; /* Run through list of hooks for output packets. */ - switch (pfil_run_hooks(V_inet6_pfil_head, &m, ifp, PFIL_OUT, inp)) { + switch (pfil_mbuf_out(V_inet6_pfil_head, &m, ifp, inp)) { case PFIL_PASS: ip6 = mtod(m, struct ip6_hdr *); break;