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
This commit is contained in:
Mateusz Guzik 2022-09-08 16:01:00 +00:00
parent 0b70e3e78b
commit dda6376b04
6 changed files with 9 additions and 9 deletions

View File

@ -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);

View File

@ -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 */

View File

@ -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;

View File

@ -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 *);

View File

@ -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 *);

View File

@ -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;