aboutsummaryrefslogtreecommitdiff
path: root/sys/nfsclient
diff options
context:
space:
mode:
authorBrooks Davis <brooks@FreeBSD.org>2006-08-09 01:56:17 +0000
committerBrooks Davis <brooks@FreeBSD.org>2006-08-09 01:56:17 +0000
commita36aa44a85a4c52936c61ad1f2f48c0bec2d2703 (patch)
tree64803d207eb90a11175a90d549f5ad720925546c /sys/nfsclient
parent9500ad1d7de091ba6a05fb7da46914e12a8f5bf9 (diff)
downloadsrc-a36aa44a85a4c52936c61ad1f2f48c0bec2d2703.tar.gz
src-a36aa44a85a4c52936c61ad1f2f48c0bec2d2703.zip
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
Notes
Notes: svn path=/head/; revision=161109
Diffstat (limited to 'sys/nfsclient')
-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 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);
/*