diff options
author | 2016-09-20 11:11:44 +0000 | |
---|---|---|
committer | 2016-09-20 11:11:44 +0000 | |
commit | c4d6bba448e82a882a4695a20e29d9398759ee20 (patch) | |
tree | bc152fde32fba556ac975c507562dceeb2a4c286 /sys/kern/uipc_socket.c | |
parent | we will also want the echo timing paramater (diff) | |
download | wireguard-openbsd-c4d6bba448e82a882a4695a20e29d9398759ee20.tar.xz wireguard-openbsd-c4d6bba448e82a882a4695a20e29d9398759ee20.zip |
Add some spl softnet assertions that will help us to find the right
places for the upcoming network lock. This might trigger some
asserts, but we have to find the missing code paths.
OK mpi@
Diffstat (limited to 'sys/kern/uipc_socket.c')
-rw-r--r-- | sys/kern/uipc_socket.c | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c index 65592765546..22135104a84 100644 --- a/sys/kern/uipc_socket.c +++ b/sys/kern/uipc_socket.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uipc_socket.c,v 1.159 2016/09/15 02:00:16 dlg Exp $ */ +/* $OpenBSD: uipc_socket.c,v 1.160 2016/09/20 11:11:44 bluhm Exp $ */ /* $NetBSD: uipc_socket.c,v 1.21 1996/02/04 02:17:52 christos Exp $ */ /* @@ -356,21 +356,16 @@ soconnect2(struct socket *so1, struct socket *so2) int sodisconnect(struct socket *so) { - int s = splsoftnet(); int error; - if ((so->so_state & SS_ISCONNECTED) == 0) { - error = ENOTCONN; - goto bad; - } - if (so->so_state & SS_ISDISCONNECTING) { - error = EALREADY; - goto bad; - } + splsoftassert(IPL_SOFTNET); + + if ((so->so_state & SS_ISCONNECTED) == 0) + return (ENOTCONN); + if (so->so_state & SS_ISDISCONNECTING) + return (EALREADY); error = (*so->so_proto->pr_usrreq)(so, PRU_DISCONNECT, NULL, NULL, NULL, curproc); -bad: - splx(s); return (error); } @@ -1509,6 +1504,8 @@ somove(struct socket *so, int wait) void sorwakeup(struct socket *so) { + splsoftassert(IPL_SOFTNET); + #ifdef SOCKET_SPLICE if (so->so_rcv.sb_flagsintr & SB_SPLICE) { /* @@ -1535,6 +1532,8 @@ sorwakeup(struct socket *so) void sowwakeup(struct socket *so) { + splsoftassert(IPL_SOFTNET); + #ifdef SOCKET_SPLICE if (so->so_snd.sb_flagsintr & SB_SPLICE) task_add(sosplice_taskq, &so->so_sp->ssp_soback->so_splicetask); |