diff options
author | 2017-03-07 09:23:27 +0000 | |
---|---|---|
committer | 2017-03-07 09:23:27 +0000 | |
commit | 143ab7fc259aff7c83770a7286feb60e15721391 (patch) | |
tree | 6c133422618844e51864253d24d9b090a48feb05 /sys/kern/uipc_socket.c | |
parent | tls_close() can return TLS_WANT_POLLIN/TLS_WANT_POLLOUT, handle them (diff) | |
download | wireguard-openbsd-143ab7fc259aff7c83770a7286feb60e15721391.tar.xz wireguard-openbsd-143ab7fc259aff7c83770a7286feb60e15721391.zip |
Do not grab the NET_LOCK() for routing sockets operations.
The only function that need the lock is rtm_output() as it messes with
the routing table. So grab the lock there since it is safe to sleep
in a process context.
ok bluhm@
Diffstat (limited to 'sys/kern/uipc_socket.c')
-rw-r--r-- | sys/kern/uipc_socket.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c index 1affe913afc..93162a4e256 100644 --- a/sys/kern/uipc_socket.c +++ b/sys/kern/uipc_socket.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uipc_socket.c,v 1.178 2017/03/03 09:41:20 mpi Exp $ */ +/* $OpenBSD: uipc_socket.c,v 1.179 2017/03/07 09:23:27 mpi Exp $ */ /* $NetBSD: uipc_socket.c,v 1.21 1996/02/04 02:17:52 christos Exp $ */ /* @@ -1038,11 +1038,12 @@ sorflush(struct socket *so) { struct sockbuf *sb = &so->so_rcv; struct protosw *pr = so->so_proto; + sa_family_t af = pr->pr_domain->dom_family; struct sockbuf asb; sb->sb_flags |= SB_NOINTR; sblock(sb, M_WAITOK, - (pr->pr_domain->dom_family != PF_LOCAL) ? &netlock : NULL); + (af != PF_LOCAL && af != PF_ROUTE) ? &netlock : NULL); socantrcvmore(so); sbunlock(sb); asb = *sb; |