summaryrefslogtreecommitdiffstats
path: root/sys/kern/uipc_socket.c
diff options
context:
space:
mode:
authorclaudio <claudio@openbsd.org>2017-05-27 18:50:53 +0000
committerclaudio <claudio@openbsd.org>2017-05-27 18:50:53 +0000
commit8fa79911939348bcc6c3bb5015098555a1b4f5c8 (patch)
tree89b34db4346bd761096ca5a50363dad701c5b1c7 /sys/kern/uipc_socket.c
parentProtect the global list of softc with the NET_LOCK(). (diff)
downloadwireguard-openbsd-8fa79911939348bcc6c3bb5015098555a1b4f5c8.tar.xz
wireguard-openbsd-8fa79911939348bcc6c3bb5015098555a1b4f5c8.zip
Push the NET_LOCK down into PF_KEY so that it can be treated like PF_ROUTE.
Only pfkeyv2_send() needs the NET_LOCK() so grab it at the start and release at the end. This should allow to push the locks down in other places. OK mpi@, bluhm@
Diffstat (limited to 'sys/kern/uipc_socket.c')
-rw-r--r--sys/kern/uipc_socket.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c
index 29323e8a41f..6003a4661c1 100644
--- a/sys/kern/uipc_socket.c
+++ b/sys/kern/uipc_socket.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uipc_socket.c,v 1.184 2017/05/15 13:00:10 mpi Exp $ */
+/* $OpenBSD: uipc_socket.c,v 1.185 2017/05/27 18:50:53 claudio Exp $ */
/* $NetBSD: uipc_socket.c,v 1.21 1996/02/04 02:17:52 christos Exp $ */
/*
@@ -1043,7 +1043,8 @@ sorflush(struct socket *so)
sb->sb_flags |= SB_NOINTR;
sblock(sb, M_WAITOK,
- (af != PF_LOCAL && af != PF_ROUTE) ? &netlock : NULL);
+ (af != PF_LOCAL && af != PF_ROUTE && af != PF_KEY) ?
+ &netlock : NULL);
socantrcvmore(so);
sbunlock(sb);
asb = *sb;