aboutsummaryrefslogtreecommitdiff
path: root/sys/netinet/ip_output.c
diff options
context:
space:
mode:
authorGleb Smirnoff <glebius@FreeBSD.org>2019-01-31 23:01:03 +0000
committerGleb Smirnoff <glebius@FreeBSD.org>2019-01-31 23:01:03 +0000
commitb252313f0b3a4659c02e61d3a0bba471c89bcfa9 (patch)
tree129539f21574fd57abdc128138912eeee023fc89 /sys/netinet/ip_output.c
parent90f2d5012a44f34fc23a7d1743336266960510b7 (diff)
Notes
Diffstat (limited to 'sys/netinet/ip_output.c')
-rw-r--r--sys/netinet/ip_output.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/sys/netinet/ip_output.c b/sys/netinet/ip_output.c
index 7595c3f90535..0c7a26503d07 100644
--- a/sys/netinet/ip_output.c
+++ b/sys/netinet/ip_output.c
@@ -121,11 +121,16 @@ ip_output_pfil(struct mbuf **mp, struct ifnet *ifp, struct inpcb *inp,
/* Run through list of hooks for output packets. */
odst.s_addr = ip->ip_dst.s_addr;
- *error = pfil_run_hooks(&V_inet_pfil_hook, mp, ifp, PFIL_OUT, 0, inp);
- m = *mp;
- if ((*error) != 0 || m == NULL)
+ switch (pfil_run_hooks(V_inet_pfil_head, mp, ifp, PFIL_OUT, inp)) {
+ case PFIL_DROPPED:
+ *error = EPERM;
+ /* FALLTHROUGH */
+ case PFIL_CONSUMED:
return 1; /* Finished */
-
+ case PFIL_PASS:
+ *error = 0;
+ }
+ m = *mp;
ip = mtod(m, struct ip *);
/* See if destination IP address was changed by packet filter. */
@@ -568,7 +573,7 @@ sendit:
#endif /* IPSEC */
/* Jump over all PFIL processing if hooks are not active. */
- if (PFIL_HOOKED(&V_inet_pfil_hook)) {
+ if (PFIL_HOOKED_OUT(V_inet_pfil_head)) {
switch (ip_output_pfil(&m, ifp, inp, dst, &fibnum, &error)) {
case 1: /* Finished */
goto done;