summaryrefslogtreecommitdiffstats
path: root/sys/netinet/ip_fw2.c
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2004-06-24 02:01:48 +0000
committerrwatson <rwatson@FreeBSD.org>2004-06-24 02:01:48 +0000
commit93baf0b01a4613cd177b1fd2c4b2c26f01456e94 (patch)
tree8bec5c7d28a474674be9c4a8c3f3bb95c2a1f3c5 /sys/netinet/ip_fw2.c
parented101b4b5dfc35305d7862e8bbf648325eee5d46 (diff)
downloadFreeBSD-src-93baf0b01a4613cd177b1fd2c4b2c26f01456e94.zip
FreeBSD-src-93baf0b01a4613cd177b1fd2c4b2c26f01456e94.tar.gz
When asserting non-Giant locks in the network stack, also assert
Giant if debug.mpsafenet=0, as any points that require synchronization in the SMPng world also required it in the Giant-world: - inpcb locks (including IPv6) - inpcbinfo locks (including IPv6) - dummynet subsystem lock - ipfw2 subsystem lock
Diffstat (limited to 'sys/netinet/ip_fw2.c')
-rw-r--r--sys/netinet/ip_fw2.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/netinet/ip_fw2.c b/sys/netinet/ip_fw2.c
index abe1af6..f640e24 100644
--- a/sys/netinet/ip_fw2.c
+++ b/sys/netinet/ip_fw2.c
@@ -136,7 +136,10 @@ struct ip_fw_chain {
#define IPFW_LOCK_DESTROY(_chain) mtx_destroy(&(_chain)->mtx)
#define IPFW_LOCK(_chain) mtx_lock(&(_chain)->mtx)
#define IPFW_UNLOCK(_chain) mtx_unlock(&(_chain)->mtx)
-#define IPFW_LOCK_ASSERT(_chain) mtx_assert(&(_chain)->mtx, MA_OWNED)
+#define IPFW_LOCK_ASSERT(_chain) do { \
+ mtx_assert(&(_chain)->mtx, MA_OWNED); \
+ NET_ASSERT_GIANT(); \
+} while (0)
/*
* list of rules for layer 3
OpenPOWER on IntegriCloud