diff --git a/sys/fs/nfsclient/nfs_clvnops.c b/sys/fs/nfsclient/nfs_clvnops.c index 047e3eb65a86..937453c9e058 100644 --- a/sys/fs/nfsclient/nfs_clvnops.c +++ b/sys/fs/nfsclient/nfs_clvnops.c @@ -1374,7 +1374,7 @@ nfs_create(struct vop_create_args *ap) } mtx_unlock(&dnp->n_mtx); - CURVNET_SET(nmp->nm_sockreq.nr_so->so_vnet); + CURVNET_SET(P_TO_VNET(&proc0)); #ifdef INET INIT_VNET_INET(curvnet); if (!TAILQ_EMPTY(&V_in_ifaddrhead)) diff --git a/sys/fs/nfsserver/nfs_nfsdport.c b/sys/fs/nfsserver/nfs_nfsdport.c index fdb8ed7ecd86..730a750db8e0 100644 --- a/sys/fs/nfsserver/nfs_nfsdport.c +++ b/sys/fs/nfsserver/nfs_nfsdport.c @@ -2673,6 +2673,7 @@ nfsrv_v4rootexport(void *argp, struct ucred *cred, struct thread *p) int nfsrv_getsocksndseq(struct socket *so, tcp_seq *maxp, tcp_seq *unap) { + INIT_VNET_INET(so->so_vnet); struct inpcb *inp; struct tcpcb *tp; int error = EPIPE;