summaryrefslogtreecommitdiffstats
path: root/sys/netinet6/ip6_output.c
diff options
context:
space:
mode:
authorandre <andre@FreeBSD.org>2004-08-27 15:16:24 +0000
committerandre <andre@FreeBSD.org>2004-08-27 15:16:24 +0000
commitd243747d92c4cacce93fc3a982655dc80d4886d4 (patch)
tree2f8a616b3f6fffde5d0da52a85305bbcf5376c9f /sys/netinet6/ip6_output.c
parentdd8d6f138f3ed1089978b76d0d13a754a30b12f4 (diff)
downloadFreeBSD-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_output.c')
-rw-r--r--sys/netinet6/ip6_output.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/sys/netinet6/ip6_output.c b/sys/netinet6/ip6_output.c
index f5c3559..bdee8fe 100644
--- a/sys/netinet6/ip6_output.c
+++ b/sys/netinet6/ip6_output.c
@@ -65,7 +65,6 @@
#include "opt_inet.h"
#include "opt_inet6.h"
#include "opt_ipsec.h"
-#include "opt_pfil_hooks.h"
#include <sys/param.h>
#include <sys/malloc.h>
@@ -80,9 +79,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>
@@ -936,16 +933,17 @@ skip_ipsec2:;
m->m_pkthdr.rcvif = NULL;
}
-#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 passout;
+
+ /* Run through list of hooks for output packets. */
error = pfil_run_hooks(&inet6_pfil_hook, &m, ifp, PFIL_OUT);
if (error != 0 || m == NULL)
goto done;
ip6 = mtod(m, struct ip6_hdr *);
-#endif /* PFIL_HOOKS */
+passout:
/*
* Send the packet to the outgoing interface.
* If necessary, do IPv6 fragmentation before sending.
OpenPOWER on IntegriCloud