Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 9 Nov 2016 21:51:48 +0000 (UTC)
From:      Baptiste Daroussin <bapt@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r308477 - head/sys/boot/i386/libi386
Message-ID:  <201611092151.uA9LpmM6091650@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: bapt
Date: Wed Nov  9 21:51:48 2016
New Revision: 308477
URL: https://svnweb.freebsd.org/changeset/base/308477

Log:
  make pxeboot consistent with common/dev_net.c
  
  Always define boot.netif.server in kenv in pxeboot
  Add "boot.tftproot.server" to kenv when pxeboot uses tftpfs
  Change the code order when setting env for TFTP or NFS to be the same as
  common/dev_net.c
  
  Reported by:	tsoome

Modified:
  head/sys/boot/i386/libi386/pxe.c

Modified: head/sys/boot/i386/libi386/pxe.c
==============================================================================
--- head/sys/boot/i386/libi386/pxe.c	Wed Nov  9 21:28:46 2016	(r308476)
+++ head/sys/boot/i386/libi386/pxe.c	Wed Nov  9 21:51:48 2016	(r308477)
@@ -311,6 +311,7 @@ pxe_open(struct open_file *f, ...)
 		setenv("boot.netif.ip", inet_ntoa(myip), 1);
 		setenv("boot.netif.netmask", intoa(netmask), 1);
 		setenv("boot.netif.gateway", inet_ntoa(gateip), 1);
+		setenv("boot.netif.server", inet_ntoa(rootip), 1);
 		if (bootplayer.Hardware == ETHER_TYPE) {
 		    sprintf(temp, "%6D", bootplayer.CAddr, ":");
 		    setenv("boot.netif.hwaddr", temp, 1);
@@ -324,12 +325,12 @@ pxe_open(struct open_file *f, ...)
 		printf("pxe_open: server path: %s\n", rootpath);
 		printf("pxe_open: gateway ip:  %s\n", inet_ntoa(gateip));
 
-		if (netproto == NET_NFS) {
+		if (netproto == NET_TFTP) {
+			setenv("boot.tftproot.server", inet_ntoa(rootip), 1);
+			setenv("boot.tftproot.path", rootpath, 1);
+		} else if (netproto == NET_NFS) {
 			setenv("boot.nfsroot.server", inet_ntoa(rootip), 1);
 			setenv("boot.nfsroot.path", rootpath, 1);
-		} else if (netproto == NET_TFTP) {
-			setenv("boot.netif.server", inet_ntoa(rootip), 1);
-			setenv("boot.tftproot.path", rootpath, 1);
 		}
 		setenv("dhcp.host-name", hostname, 1);
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201611092151.uA9LpmM6091650>