summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormpi <mpi@openbsd.org>2017-11-13 14:41:46 +0000
committermpi <mpi@openbsd.org>2017-11-13 14:41:46 +0000
commit3ae8e5ce59df6d5793e675919a9528cccc8a6880 (patch)
tree0b54d40315cb5f4f3183c80009e34b64c0cdbedd
parentWhen searching in copy mode, do not scroll if the result is already on (diff)
downloadwireguard-openbsd-3ae8e5ce59df6d5793e675919a9528cccc8a6880.tar.xz
wireguard-openbsd-3ae8e5ce59df6d5793e675919a9528cccc8a6880.zip
Do not call splassert_fail() if splassert_ctl is <= 0.
This matches splassert(9)s behavior and prevent noise when a CPU panic(9) and set splassert_ctl to 0. Found the hardway by sthen@
-rw-r--r--sys/sys/systm.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/sys/systm.h b/sys/sys/systm.h
index ba836006091..82abf9b873e 100644
--- a/sys/sys/systm.h
+++ b/sys/sys/systm.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: systm.h,v 1.134 2017/11/10 08:55:49 mpi Exp $ */
+/* $OpenBSD: systm.h,v 1.135 2017/11/13 14:41:46 mpi Exp $ */
/* $NetBSD: systm.h,v 1.50 1996/06/09 04:55:09 briggs Exp $ */
/*-
@@ -307,14 +307,14 @@ extern struct rwlock netlock;
#define NET_ASSERT_WLOCKED() \
do { \
int _s = rw_status(&netlock); \
- if (_s != RW_WRITE) \
+ if ((splassert_ctl > 0) && (_s != RW_WRITE)) \
splassert_fail(RW_WRITE, _s, __func__); \
} while (0)
#define NET_ASSERT_WUNLOCKED() \
do { \
int _s = rw_status(&netlock); \
- if (_s == RW_WRITE) \
+ if ((splassert_ctl > 0) && (_s == RW_WRITE)) \
splassert_fail(0, RW_WRITE, __func__); \
} while (0)
@@ -324,7 +324,7 @@ do { \
#define NET_ASSERT_LOCKED() \
do { \
int _s = rw_status(&netlock); \
- if (_s != RW_WRITE && _s != RW_READ) \
+ if ((splassert_ctl > 0) && (_s != RW_WRITE && _s != RW_READ)) \
splassert_fail(RW_READ, _s, __func__); \
} while (0)