summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormpi <mpi@openbsd.org>2017-07-27 12:08:19 +0000
committermpi <mpi@openbsd.org>2017-07-27 12:08:19 +0000
commit6e549248ab859cd975cd7e9d38c9a4b3c555901a (patch)
treea230dbd8444c8e00f2ea08ad212b67fbe5511e12
parentAssert that the KERNEL_LOCK() is held prior to call csignal() and (diff)
downloadwireguard-openbsd-6e549248ab859cd975cd7e9d38c9a4b3c555901a.tar.xz
wireguard-openbsd-6e549248ab859cd975cd7e9d38c9a4b3c555901a.zip
Stop doing an splsoftnet()/splx() dance inside the NET_LOCK().
This will allow us to not carry a returned value when entering a critical section. ok bluhm@, visa@
-rw-r--r--sys/sys/systm.h7
1 files changed, 3 insertions, 4 deletions
diff --git a/sys/sys/systm.h b/sys/sys/systm.h
index 5b9dfddceee..f83c12ffcdd 100644
--- a/sys/sys/systm.h
+++ b/sys/sys/systm.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: systm.h,v 1.131 2017/05/29 12:12:35 tedu Exp $ */
+/* $OpenBSD: systm.h,v 1.132 2017/07/27 12:08:19 mpi Exp $ */
/* $NetBSD: systm.h,v 1.50 1996/06/09 04:55:09 briggs Exp $ */
/*-
@@ -299,12 +299,12 @@ extern struct rwlock netlock;
#define NET_LOCK(s) \
do { \
rw_enter_write(&netlock); \
- s = splsoftnet(); \
+ s = IPL_SOFTNET; \
} while (0)
#define NET_UNLOCK(s) \
do { \
- splx(s); \
+ (void)s; \
rw_exit_write(&netlock); \
} while (0)
@@ -312,7 +312,6 @@ do { \
do { \
if (rw_status(&netlock) != RW_WRITE) \
splassert_fail(RW_WRITE, rw_status(&netlock), __func__);\
- splsoftassert(IPL_SOFTNET); \
} while (0)
#define NET_ASSERT_UNLOCKED() \