diff options
-rw-r--r-- | sys/nfsclient/nfs_vfsops.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/sys/nfsclient/nfs_vfsops.c b/sys/nfsclient/nfs_vfsops.c index bd9adc2154ff..6a29da811f1c 100644 --- a/sys/nfsclient/nfs_vfsops.c +++ b/sys/nfsclient/nfs_vfsops.c @@ -397,9 +397,11 @@ nfs_mountroot(struct mount *mp, struct thread *td) struct nfsv3_diskless *nd = &nfsv3_diskless; struct socket *so; struct vnode *vp; + struct ifreq ir; int error, i; u_long l; char buf[128]; + char *cp; NET_ASSERT_GIANT(); @@ -448,6 +450,14 @@ nfs_mountroot(struct mount *mp, struct thread *td) error = ifioctl(so, SIOCAIFADDR, (caddr_t)&nd->myif, td); if (error) panic("nfs_mountroot: SIOCAIFADDR: %d", error); + if ((cp = getenv("boot.netif.mtu")) != NULL) { + ir.ifr_mtu = strtol(cp, NULL, 10); + bcopy(nd->myif.ifra_name, ir.ifr_name, IFNAMSIZ); + freeenv(cp); + error = ifioctl(so, SIOCSIFMTU, (caddr_t)&ir, td); + if (error) + printf("nfs_mountroot: SIOCSIFMTU: %d", error); + } soclose(so); /* |