summaryrefslogtreecommitdiffstats
path: root/sys/netinet6/ip6_input.c
diff options
context:
space:
mode:
authorcsjp <csjp@FreeBSD.org>2006-02-02 03:13:16 +0000
committercsjp <csjp@FreeBSD.org>2006-02-02 03:13:16 +0000
commit31292a14b63b17ba5db98a0848f9166080240c14 (patch)
tree70762151820deceeeabd2497892bd015c4607785 /sys/netinet6/ip6_input.c
parentee6a12ceacf369efe24e49fa5ba813f41b43bd89 (diff)
downloadFreeBSD-src-31292a14b63b17ba5db98a0848f9166080240c14.zip
FreeBSD-src-31292a14b63b17ba5db98a0848f9166080240c14.tar.gz
Somewhat re-factor the read/write locking mechanism associated with the packet
filtering mechanisms to use the new rwlock(9) locking API: - Drop the variables stored in the phil_head structure which were specific to conditions and the home rolled read/write locking mechanism. - Drop some includes which were used for condition variables - Drop the inline functions, and convert them to macros. Also, move these macros into pfil.h - Move pfil list locking macros intp phil.h as well - Rename ph_busy_count to ph_nhooks. This variable will represent the number of IN/OUT hooks registered with the pfil head structure - Define PFIL_HOOKED macro which evaluates to true if there are any hooks to be ran by pfil_run_hooks - In the IP/IP6 stacks, change the ph_busy_count comparison to use the new PFIL_HOOKED macro. - Drop optimization in pfil_run_hooks which checks to see if there are any hooks to be ran, and returns if not. This check is already performed by the IP stacks when they call: if (!PFIL_HOOKED(ph)) goto skip_hooks; - Drop in assertion which makes sure that the number of hooks never drops below 0 for good measure. This in theory should never happen, and if it does than there are problems somewhere - Drop special logic around PFIL_WAITOK because rw_wlock(9) does not sleep - Drop variables which support home rolled read/write locking mechanism from the IPFW firewall chain structure. - Swap out the read/write firewall chain lock internal to use the rwlock(9) API instead of our home rolled version - Convert the inlined functions to macros Reviewed by: mlaier, andre, glebius Thanks to: jhb for the new locking API
Diffstat (limited to 'sys/netinet6/ip6_input.c')
-rw-r--r--sys/netinet6/ip6_input.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/netinet6/ip6_input.c b/sys/netinet6/ip6_input.c
index 3b34557..a7f5a7c 100644
--- a/sys/netinet6/ip6_input.c
+++ b/sys/netinet6/ip6_input.c
@@ -414,7 +414,7 @@ ip6_input(m)
odst = ip6->ip6_dst;
/* Jump over all PFIL processing if hooks are not active. */
- if (inet6_pfil_hook.ph_busy_count == -1)
+ if (!PFIL_HOOKED(&inet6_pfil_hook))
goto passin;
if (pfil_run_hooks(&inet6_pfil_hook, &m, m->m_pkthdr.rcvif, PFIL_IN, NULL))
OpenPOWER on IntegriCloud