aboutsummaryrefslogtreecommitdiff
path: root/sys/kern/uipc_usrreq.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/kern/uipc_usrreq.c')
-rw-r--r--sys/kern/uipc_usrreq.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/sys/kern/uipc_usrreq.c b/sys/kern/uipc_usrreq.c
index d049688ae54c..4bad3869fe85 100644
--- a/sys/kern/uipc_usrreq.c
+++ b/sys/kern/uipc_usrreq.c
@@ -1311,7 +1311,9 @@ unp_connect(struct socket *so, struct sockaddr *nam, struct thread *td)
}
if (so->so_proto->pr_flags & PR_CONNREQUIRED) {
if (so2->so_options & SO_ACCEPTCONN) {
+ CURVNET_SET(so2->so_vnet);
so3 = sonewconn(so2, 0);
+ CURVNET_RESTORE();
} else
so3 = NULL;
if (so3 == NULL) {
@@ -2215,8 +2217,14 @@ unp_gc(__unused void *arg, int pending)
* struct files associated with these sockets but leave each socket
* with one remaining ref.
*/
- for (i = 0; i < total; i++)
- sorflush(unref[i]->f_data);
+ for (i = 0; i < total; i++) {
+ struct socket *so;
+
+ so = unref[i]->f_data;
+ CURVNET_SET(so->so_vnet);
+ sorflush(so);
+ CURVNET_RESTORE();
+ }
/*
* And finally release the sockets so they can be reclaimed.