summaryrefslogtreecommitdiffstats
path: root/sys/netinet/ip_dummynet.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_dummynet.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_dummynet.c')
-rw-r--r--sys/netinet/ip_dummynet.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/netinet/ip_dummynet.c b/sys/netinet/ip_dummynet.c
index 2559c7e..62f56a6 100644
--- a/sys/netinet/ip_dummynet.c
+++ b/sys/netinet/ip_dummynet.c
@@ -171,7 +171,10 @@ static struct mtx dummynet_mtx;
#define DUMMYNET_LOCK_DESTROY() mtx_destroy(&dummynet_mtx)
#define DUMMYNET_LOCK() mtx_lock(&dummynet_mtx)
#define DUMMYNET_UNLOCK() mtx_unlock(&dummynet_mtx)
-#define DUMMYNET_LOCK_ASSERT() mtx_assert(&dummynet_mtx, MA_OWNED)
+#define DUMMYNET_LOCK_ASSERT() do { \
+ mtx_assert(&dummynet_mtx, MA_OWNED); \
+ NET_ASSERT_GIANT(); \
+} while (0)
static int config_pipe(struct dn_pipe *p);
static int ip_dn_ctl(struct sockopt *sopt);
OpenPOWER on IntegriCloud