diff options
Diffstat (limited to 'sys/nfsclient')
-rw-r--r-- | sys/nfsclient/bootp_subr.c | 9 | ||||
-rw-r--r-- | sys/nfsclient/nfs_vfsops.c | 15 |
2 files changed, 10 insertions, 14 deletions
diff --git a/sys/nfsclient/bootp_subr.c b/sys/nfsclient/bootp_subr.c index b51b38d..d3151c9 100644 --- a/sys/nfsclient/bootp_subr.c +++ b/sys/nfsclient/bootp_subr.c @@ -48,6 +48,7 @@ __FBSDID("$FreeBSD$"); #include <sys/param.h> #include <sys/systm.h> +#include <sys/jail.h> #include <sys/kernel.h> #include <sys/sockio.h> #include <sys/malloc.h> @@ -1558,10 +1559,10 @@ bootpc_decode_reply(struct nfsv3_diskless *nd, struct bootpc_ifcontext *ifctx, printf("hostname %s (ignored) ", p); } else { strcpy(nd->my_hostnam, p); - mtx_lock(&hostname_mtx); - strcpy(G_hostname, p); - printf("hostname %s ", G_hostname); - mtx_unlock(&hostname_mtx); + mtx_lock(&prison0.pr_mtx); + strcpy(prison0.pr_host, p); + mtx_unlock(&prison0.pr_mtx); + printf("hostname %s ", p); gctx->sethostname = ifctx; } } diff --git a/sys/nfsclient/nfs_vfsops.c b/sys/nfsclient/nfs_vfsops.c index 7d48023..5bc5cfd 100644 --- a/sys/nfsclient/nfs_vfsops.c +++ b/sys/nfsclient/nfs_vfsops.c @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); #include <sys/kernel.h> #include <sys/bio.h> #include <sys/buf.h> +#include <sys/jail.h> #include <sys/lock.h> #include <sys/malloc.h> #include <sys/mbuf.h> @@ -56,7 +57,6 @@ __FBSDID("$FreeBSD$"); #include <sys/sysctl.h> #include <sys/vnode.h> #include <sys/signalvar.h> -#include <sys/vimage.h> #include <vm/vm.h> #include <vm/vm_extern.h> @@ -415,12 +415,11 @@ int nfs_mountroot(struct mount *mp) { struct thread *td = curthread; - INIT_VPROCG(TD_TO_VPROCG(td)); struct nfsv3_diskless *nd = &nfsv3_diskless; struct socket *so; struct vnode *vp; struct ifreq ir; - int error, i; + int error; u_long l; char buf[128]; char *cp; @@ -524,13 +523,9 @@ nfs_mountroot(struct mount *mp) * set hostname here and then let the "/etc/rc.xxx" files * mount the right /var based upon its preset value. */ - mtx_lock(&hostname_mtx); - bcopy(nd->my_hostnam, V_hostname, MAXHOSTNAMELEN); - V_hostname[MAXHOSTNAMELEN - 1] = '\0'; - for (i = 0; i < MAXHOSTNAMELEN; i++) - if (V_hostname[i] == '\0') - break; - mtx_unlock(&hostname_mtx); + mtx_lock(&prison0.pr_mtx); + strlcpy(prison0.pr_host, nd->my_hostnam, sizeof (prison0.pr_host)); + mtx_unlock(&prison0.pr_mtx); inittodr(ntohl(nd->root_time)); return (0); } |