diff options
author | andre <andre@FreeBSD.org> | 2004-08-27 15:16:24 +0000 |
---|---|---|
committer | andre <andre@FreeBSD.org> | 2004-08-27 15:16:24 +0000 |
commit | d243747d92c4cacce93fc3a982655dc80d4886d4 (patch) | |
tree | 2f8a616b3f6fffde5d0da52a85305bbcf5376c9f /sys/netinet6/ip6_forward.c | |
parent | dd8d6f138f3ed1089978b76d0d13a754a30b12f4 (diff) | |
download | FreeBSD-src-d243747d92c4cacce93fc3a982655dc80d4886d4.zip FreeBSD-src-d243747d92c4cacce93fc3a982655dc80d4886d4.tar.gz |
Always compile PFIL_HOOKS into the kernel and remove the associated kernel
compile option. All FreeBSD packet filters now use the PFIL_HOOKS API and
thus it becomes a standard part of the network stack.
If no hooks are connected the entire packet filter hooks section and related
activities are jumped over. This removes any performance impact if no hooks
are active.
Both OpenBSD and DragonFlyBSD have integrated PFIL_HOOKS permanently as well.
Diffstat (limited to 'sys/netinet6/ip6_forward.c')
-rw-r--r-- | sys/netinet6/ip6_forward.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/sys/netinet6/ip6_forward.c b/sys/netinet6/ip6_forward.c index 689404b..94206ab 100644 --- a/sys/netinet6/ip6_forward.c +++ b/sys/netinet6/ip6_forward.c @@ -34,7 +34,6 @@ #include "opt_inet.h" #include "opt_inet6.h" #include "opt_ipsec.h" -#include "opt_pfil_hooks.h" #include <sys/param.h> #include <sys/systm.h> @@ -50,9 +49,7 @@ #include <net/if.h> #include <net/route.h> -#ifdef PFIL_HOOKS #include <net/pfil.h> -#endif #include <netinet/in.h> #include <netinet/in_var.h> @@ -578,18 +575,19 @@ ip6_forward(m, srcrt) in6_clearscope(&ip6->ip6_src); in6_clearscope(&ip6->ip6_dst); -#ifdef PFIL_HOOKS - /* - * Run through list of hooks for output packets. - */ + /* Jump over all PFIL processing if hooks are not active. */ + if (inet6_pfil_hook.ph_busy_count == -1) + goto pass; + + /* Run through list of hooks for output packets. */ 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 *); -#endif /* PFIL_HOOKS */ +pass: error = nd6_output(rt->rt_ifp, origifp, m, dst, rt); if (error) { in6_ifstat_inc(rt->rt_ifp, ifs6_out_discard); @@ -605,9 +603,7 @@ ip6_forward(m, srcrt) } } -#ifdef PFIL_HOOKS senderr: -#endif if (mcopy == NULL) return; switch (error) { |