summaryrefslogtreecommitdiffstats
path: root/sys/net/bpfdesc.h
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2004-03-29 00:33:39 +0000
committerrwatson <rwatson@FreeBSD.org>2004-03-29 00:33:39 +0000
commit8a581b46e320908c117b12940cbc4571e4feb622 (patch)
treee965447e0c71f70c97a3f7241d77ac35c98e321a /sys/net/bpfdesc.h
parent0feec337577c7f4d84f9da68b5294750de293ab7 (diff)
downloadFreeBSD-src-8a581b46e320908c117b12940cbc4571e4feb622.zip
FreeBSD-src-8a581b46e320908c117b12940cbc4571e4feb622.tar.gz
Modify BPF descriptor assertions to assert Giant when a BPF descriptor
lock is asserted and running non-MPSAFE.
Diffstat (limited to 'sys/net/bpfdesc.h')
-rw-r--r--sys/net/bpfdesc.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/net/bpfdesc.h b/sys/net/bpfdesc.h
index 46892f6..58f9d4e 100644
--- a/sys/net/bpfdesc.h
+++ b/sys/net/bpfdesc.h
@@ -102,7 +102,10 @@ struct bpf_d {
#define BPFD_LOCK(bd) mtx_lock(&(bd)->bd_mtx)
#define BPFD_UNLOCK(bd) mtx_unlock(&(bd)->bd_mtx)
-#define BPFD_LOCK_ASSERT(bd) mtx_assert(&(bd)->bd_mtx, MA_OWNED)
+#define BPFD_LOCK_ASSERT(bd) do { \
+ mtx_assert(&(bd)->bd_mtx, MA_OWNED); \
+ NET_ASSERT_GIANT(); \
+} while (0)
/* Test whether a BPF is ready for read(). */
#define bpf_ready(bd) \
OpenPOWER on IntegriCloud