aboutsummaryrefslogtreecommitdiff
path: root/sys/netinet6/ip6_forward.c
diff options
context:
space:
mode:
authorSam Leffler <sam@FreeBSD.org>2003-09-30 04:46:08 +0000
committerSam Leffler <sam@FreeBSD.org>2003-09-30 04:46:08 +0000
commitb140bc1fc8dfeded04f2e7ffd6e13f198531c53e (patch)
treee69e397b08ceb0859fe952a0aca6ef40dc00ff1d /sys/netinet6/ip6_forward.c
parent9afe34c1504a202b552587e0dcecc49cd3a3e380 (diff)
downloadsrc-b140bc1fc8dfeded04f2e7ffd6e13f198531c53e.tar.gz
src-b140bc1fc8dfeded04f2e7ffd6e13f198531c53e.zip
Correct pfil_run_hooks return handling: if the return value is non-zero
then the mbuf has been consumed by a hook; otherwise beware of a null mbuf return (gack). In particular the bridge was doing the wrong thing. While in the ipv6 code make it's handling of pfil_run_hooks identical to netbsd. Pointed out by: Pyun YongHyeon <yongari@kt-is.co.kr>
Notes
Notes: svn path=/head/; revision=120593
Diffstat (limited to 'sys/netinet6/ip6_forward.c')
-rw-r--r--sys/netinet6/ip6_forward.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/sys/netinet6/ip6_forward.c b/sys/netinet6/ip6_forward.c
index 9233aba5a290..b625f0aafae1 100644
--- a/sys/netinet6/ip6_forward.c
+++ b/sys/netinet6/ip6_forward.c
@@ -522,10 +522,9 @@ ip6_forward(m, srcrt)
/*
* Run through list of hooks for output packets.
*/
- if (pfil_run_hooks(&inet6_pfil_hook, &m, rt->rt_ifp, PFIL_OUT) != 0) {
- error = EHOSTUNREACH;
- goto freecopy;
- }
+ error = pfil_run_hooks(&inet6_pfil_hook, &m, rt->rt_ifp, PFIL_OUT);
+ if (error != 0)
+ goto senderr;
if (m == NULL)
goto freecopy;
ip6 = mtod(m, struct ip6_hdr *);
@@ -545,6 +544,9 @@ ip6_forward(m, srcrt)
goto freecopy;
}
}
+#ifdef PFIL_HOOKS
+senderr:
+#endif
if (mcopy == NULL)
return;
switch (error) {