summaryrefslogtreecommitdiffstats
path: root/sys/nfsclient/nfs_vfsops.c
diff options
context:
space:
mode:
authorbrooks <brooks@FreeBSD.org>2006-08-09 01:56:17 +0000
committerbrooks <brooks@FreeBSD.org>2006-08-09 01:56:17 +0000
commitf9c7fb948da6c96f9d9bcb34d0a36e10f80939c7 (patch)
tree64803d207eb90a11175a90d549f5ad720925546c /sys/nfsclient/nfs_vfsops.c
parentf29929e962e9d900221a2007f70388b425cd6b9c (diff)
downloadFreeBSD-src-f9c7fb948da6c96f9d9bcb34d0a36e10f80939c7.zip
FreeBSD-src-f9c7fb948da6c96f9d9bcb34d0a36e10f80939c7.tar.gz
Add a new kernel environment variable "boot.netif.mtu" which is used to
set the MTU prior to mounting root via NFS. This is required if the server supports a higher than default MTU because the client will not see the responses otherwise. MFC after: 3 weeks
Diffstat (limited to 'sys/nfsclient/nfs_vfsops.c')
-rw-r--r--sys/nfsclient/nfs_vfsops.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/sys/nfsclient/nfs_vfsops.c b/sys/nfsclient/nfs_vfsops.c
index bd9adc2..6a29da8 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);
/*
OpenPOWER on IntegriCloud