diff --git a/sys/net/bpfdesc.h b/sys/net/bpfdesc.h index 46892f6e3a23..58f9d4e7b3fd 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) \