From owner-svn-src-all@freebsd.org Mon Mar 21 15:06:51 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E3C31AD887E; Mon, 21 Mar 2016 15:06:51 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B5705FE5; Mon, 21 Mar 2016 15:06:51 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2LF6oHF009053; Mon, 21 Mar 2016 15:06:50 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2LF6ovE009051; Mon, 21 Mar 2016 15:06:50 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201603211506.u2LF6ovE009051@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 21 Mar 2016 15:06:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297151 - in head/sys/boot: common i386/libi386 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Mar 2016 15:06:52 -0000 Author: ian Date: Mon Mar 21 15:06:50 2016 New Revision: 297151 URL: https://svnweb.freebsd.org/changeset/base/297151 Log: 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. Modified: head/sys/boot/common/dev_net.c head/sys/boot/i386/libi386/pxe.c Modified: head/sys/boot/common/dev_net.c ============================================================================== --- head/sys/boot/common/dev_net.c Mon Mar 21 14:58:12 2016 (r297150) +++ head/sys/boot/common/dev_net.c Mon Mar 21 15:06:50 2016 (r297151) @@ -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; Modified: head/sys/boot/i386/libi386/pxe.c ============================================================================== --- head/sys/boot/i386/libi386/pxe.c Mon Mar 21 14:58:12 2016 (r297150) +++ head/sys/boot/i386/libi386/pxe.c Mon Mar 21 15:06:50 2016 (r297151) @@ -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);