Honor the ip address given in the root-path dhcp option.

PR:	21743
Submitted by:	Brian Candler <B.Candler@pobox.com>
This commit is contained in:
ps 2000-11-05 14:55:09 +00:00
parent 3bf3c42bf7
commit 26690141b4
2 changed files with 7 additions and 9 deletions

View File

@ -93,10 +93,6 @@ __reml.S: ${.CURDIR}/../libc/alpha/gen/divrem.m4
${.ALLSRC} > ${.TARGET}
.endif
# network support from libc
.PATH: ${.CURDIR}/../libc/net
SRCS+= inet_ntoa.c inet_addr.c
# _setjmp/_longjmp
.PATH: ${.CURDIR}/${MACHINE_ARCH}
SRCS+= _setjmp.S
@ -114,7 +110,7 @@ SRCS+= closeall.c dev.c ioctl.c nullfs.c stat.c \
fstat.c close.c lseek.c open.c read.c write.c readdir.c
# network routines
SRCS+= arp.c ether.c in_cksum.c net.c udp.c netif.c rpc.c
SRCS+= arp.c ether.c inet_ntoa.c in_cksum.c net.c udp.c netif.c rpc.c
# network info services:
SRCS+= bootp.c rarp.c bootparam.c

View File

@ -286,11 +286,13 @@ pxe_open(struct open_file *f, ...)
if (!rootpath[1])
strcpy(rootpath, PXENFSROOTPATH);
for(i=0; i<FNAME_SIZE; i++)
if(rootpath[i] == ':')
for (i = 0; i < FNAME_SIZE; i++)
if (rootpath[i] == ':')
break;
if(i && i != FNAME_SIZE) {
i++;
if (i && i != FNAME_SIZE) {
rootpath[i++] = '\0';
if (inet_addr(&rootpath[0]) != INADDR_NONE)
rootip.s_addr = inet_addr(&rootpath[0]);
bcopy(&rootpath[i], &temp[0], strlen(&rootpath[i])+1);
bcopy(&temp[0], &rootpath[0], strlen(&rootpath[i])+1);
}