summaryrefslogtreecommitdiff
path: root/sys/kern/uipc_socket2.c
diff options
context:
space:
mode:
authorMartin Pieuchot <mpi@cvs.openbsd.org>2018-05-07 15:51:54 +0000
committerMartin Pieuchot <mpi@cvs.openbsd.org>2018-05-07 15:51:54 +0000
commit801555ec138f7e8ee6b92513b49b8d185acf0954 (patch)
tree6670b4f311097cf2a42a2384974111b2b6f16187 /sys/kern/uipc_socket2.c
parent2737e295071b9ee276ea1a3c59a9077e8008ded4 (diff)
Grab the KERNEL_LOCK() for unix/routing/pfkey sockets in solock()...
...and release it in sounlock(). This will allows us to progressively remove the KERNEL_LOCK() in syscalls. ok visa@ some time ago
Diffstat (limited to 'sys/kern/uipc_socket2.c')
-rw-r--r--sys/kern/uipc_socket2.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/sys/kern/uipc_socket2.c b/sys/kern/uipc_socket2.c
index ec2b099cace..8bb11fd97a1 100644
--- a/sys/kern/uipc_socket2.c
+++ b/sys/kern/uipc_socket2.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uipc_socket2.c,v 1.92 2018/04/08 18:57:39 guenther Exp $ */
+/* $OpenBSD: uipc_socket2.c,v 1.93 2018/05/07 15:51:53 mpi Exp $ */
/* $NetBSD: uipc_socket2.c,v 1.11 1996/02/04 02:17:55 christos Exp $ */
/*
@@ -281,8 +281,10 @@ solock(struct socket *so)
(so->so_proto->pr_domain->dom_family != PF_ROUTE) &&
(so->so_proto->pr_domain->dom_family != PF_KEY))
NET_LOCK();
- else
+ else {
+ KERNEL_LOCK();
s = -42;
+ }
return (s);
}
@@ -292,6 +294,9 @@ sounlock(int s)
{
if (s != -42)
NET_UNLOCK();
+ else {
+ KERNEL_UNLOCK();
+ }
}
void