summaryrefslogtreecommitdiffstats
path: root/sys/kern/uipc_socket.c
diff options
context:
space:
mode:
authorbz <bz@FreeBSD.org>2010-02-20 22:29:28 +0000
committerbz <bz@FreeBSD.org>2010-02-20 22:29:28 +0000
commit7772630fb3afe62bfc6b65e13accda35f5633446 (patch)
tree26930e3a8d1efbb1f68432f2d6afe80abc4c798d /sys/kern/uipc_socket.c
parentd4d645fa1a7f68d4629e804a4d916ffcfaeaf589 (diff)
downloadFreeBSD-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
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 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);
}
OpenPOWER on IntegriCloud