aboutsummaryrefslogtreecommitdiff
path: root/sys/boot/common/dev_net.c
diff options
context:
space:
mode:
authorBaptiste Daroussin <bapt@FreeBSD.org>2017-05-06 19:23:58 +0000
committerBaptiste Daroussin <bapt@FreeBSD.org>2017-05-06 19:23:58 +0000
commita872bf12f8c976591eb3150fcbd0509575b917d0 (patch)
treee29a98865e16b7c75ed2c826bb68874f6d1156f8 /sys/boot/common/dev_net.c
parentf831d9368aff727c95e3029b5e2a27acde504a58 (diff)
downloadsrc-a872bf12f8c976591eb3150fcbd0509575b917d0.tar.gz
src-a872bf12f8c976591eb3150fcbd0509575b917d0.zip
distinguish NFS versus TFTP boot by rootpath
Don't use DHCP 150 option to decide which protocol use to netboot. When root-path includes ip address - go thru NFS, if ip address not exists in root-path - go thru TFTP from server which ip address is in next-server. But there is one limitation - only one tftp server in network to provide loader and everything else. Does enybody use more than only one? Submitted by: kczekirda Sponsored by: Oktawave MFC after: 3 weeks Relnote: Yes Differential Revision: https://reviews.freebsd.org/D8740
Notes
Notes: svn path=/head/; revision=317886
Diffstat (limited to 'sys/boot/common/dev_net.c')
-rw-r--r--sys/boot/common/dev_net.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/sys/boot/common/dev_net.c b/sys/boot/common/dev_net.c
index 1795767dc5b3..c9162975d3b9 100644
--- a/sys/boot/common/dev_net.c
+++ b/sys/boot/common/dev_net.c
@@ -312,8 +312,11 @@ net_getparams(int sock)
return (EIO);
}
exit:
- if ((rootaddr = net_parse_rootpath()) != INADDR_NONE)
+ netproto = NET_TFTP;
+ if ((rootaddr = net_parse_rootpath()) != INADDR_NONE) {
+ netproto = NET_NFS;
rootip.s_addr = rootaddr;
+ }
#ifdef NETIF_DEBUG
if (debug) {
@@ -365,13 +368,6 @@ net_parse_rootpath()
int i;
n_long addr = INADDR_NONE;
- netproto = NET_NFS;
-
- if (tftpip.s_addr != 0) {
- netproto = NET_TFTP;
- addr = tftpip.s_addr;
- }
-
for (i = 0; rootpath[i] != '\0' && i < FNAME_SIZE; i++)
if (rootpath[i] == ':')
break;