diff options
author | Ian Lepore <ian@FreeBSD.org> | 2016-03-21 15:06:50 +0000 |
---|---|---|
committer | Ian Lepore <ian@FreeBSD.org> | 2016-03-21 15:06:50 +0000 |
commit | 98acd232ad7a81d972dd4584dbdf0931857a6af7 (patch) | |
tree | 99893910cc465248bf5d986401eafff0e0016328 | |
parent | 00f66a52368ec96de809d1a7a1f73f0fbed9b817 (diff) | |
download | src-98acd232ad7a81d972dd4584dbdf0931857a6af7.tar.gz src-98acd232ad7a81d972dd4584dbdf0931857a6af7.zip |
If the dhcp server provided an interface-mtu option, transcribe the value
to the boot.netif.mtu env var, which will be picked up by pre-existing code
in nfs_mountroot() and used to configure the interface accordingly.
This should bring the same functionality when the bootp/dhcp work is done
by loader(8) as r297150 does for the in-kernel BOOTP case.
Notes
Notes:
svn path=/head/; revision=297151
-rw-r--r-- | sys/boot/common/dev_net.c | 6 | ||||
-rw-r--r-- | sys/boot/i386/libi386/pxe.c | 5 |
2 files changed, 11 insertions, 0 deletions
diff --git a/sys/boot/common/dev_net.c b/sys/boot/common/dev_net.c index 873b28d53c6d..ed07a2cfc15b 100644 --- a/sys/boot/common/dev_net.c +++ b/sys/boot/common/dev_net.c @@ -169,6 +169,12 @@ net_open(struct open_file *f, ...) setenv("boot.netif.gateway", inet_ntoa(gateip), 1); setenv("boot.nfsroot.server", inet_ntoa(rootip), 1); setenv("boot.nfsroot.path", rootpath, 1); + if (intf_mtu != 0) { + char mtu[16]; + sprintf(mtu, "%u", intf_mtu); + setenv("boot.netif.mtu", mtu, 1); + } + } netdev_opens++; f->f_devdata = &netdev_sock; diff --git a/sys/boot/i386/libi386/pxe.c b/sys/boot/i386/libi386/pxe.c index efa04fc81529..d67665e46c5e 100644 --- a/sys/boot/i386/libi386/pxe.c +++ b/sys/boot/i386/libi386/pxe.c @@ -310,6 +310,11 @@ pxe_open(struct open_file *f, ...) sprintf(temp, "%6D", bootplayer.CAddr, ":"); setenv("boot.netif.hwaddr", temp, 1); } + if (intf_mtu != 0) { + char mtu[16]; + sprintf(mtu, "%u", intf_mtu); + setenv("boot.netif.mtu", mtu, 1); + } #ifdef LOADER_NFS_SUPPORT printf("pxe_open: server addr: %s\n", inet_ntoa(rootip)); printf("pxe_open: server path: %s\n", rootpath); |