diff options
author | bz <bz@FreeBSD.org> | 2010-02-20 22:29:28 +0000 |
---|---|---|
committer | bz <bz@FreeBSD.org> | 2010-02-20 22:29:28 +0000 |
commit | 7772630fb3afe62bfc6b65e13accda35f5633446 (patch) | |
tree | 26930e3a8d1efbb1f68432f2d6afe80abc4c798d | |
parent | d4d645fa1a7f68d4629e804a4d916ffcfaeaf589 (diff) | |
download | FreeBSD-src-7772630fb3afe62bfc6b65e13accda35f5633446.zip FreeBSD-src-7772630fb3afe62bfc6b65e13accda35f5633446.tar.gz |
Set curvnet earlier so that it also covers calls to sodisconnect(), which
before were possibly panicing the system in ULP code in the VIMAGE case.
Submitted by: Igor (igor ispsystem.com)
MFC after: 5 days
-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 cc16c49..5cbdc40 100644 --- a/sys/kern/uipc_socket.c +++ b/sys/kern/uipc_socket.c @@ -773,6 +773,8 @@ soconnect(struct socket *so, struct sockaddr *nam, struct thread *td) if (so->so_options & SO_ACCEPTCONN) return (EOPNOTSUPP); + + CURVNET_SET(so->so_vnet); /* * If protocol is connection-based, can only connect once. * Otherwise, if connected, try to disconnect first. This allows @@ -788,10 +790,9 @@ soconnect(struct socket *so, struct sockaddr *nam, struct thread *td) * biting us. */ so->so_error = 0; - CURVNET_SET(so->so_vnet); error = (*so->so_proto->pr_usrreqs->pru_connect)(so, nam, td); - CURVNET_RESTORE(); } + CURVNET_RESTORE(); return (error); } |