diff options
author | ps <ps@FreeBSD.org> | 2000-11-05 14:55:09 +0000 |
---|---|---|
committer | ps <ps@FreeBSD.org> | 2000-11-05 14:55:09 +0000 |
commit | 26690141b4259c56d15afa46616002f9768ab9f2 (patch) | |
tree | 8e8b021a79aeb98464bfd2dcf503d2ca72c0668d | |
parent | 3bf3c42bf761add504ba3043caba774aca3c5a19 (diff) | |
download | FreeBSD-src-26690141b4259c56d15afa46616002f9768ab9f2.zip FreeBSD-src-26690141b4259c56d15afa46616002f9768ab9f2.tar.gz |
Honor the ip address given in the root-path dhcp option.
PR: 21743
Submitted by: Brian Candler <B.Candler@pobox.com>
-rw-r--r-- | lib/libstand/Makefile | 6 | ||||
-rw-r--r-- | sys/boot/i386/libi386/pxe.c | 10 |
2 files changed, 7 insertions, 9 deletions
diff --git a/lib/libstand/Makefile b/lib/libstand/Makefile index 75e95af..7d2a2ca 100644 --- a/lib/libstand/Makefile +++ b/lib/libstand/Makefile @@ -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 diff --git a/sys/boot/i386/libi386/pxe.c b/sys/boot/i386/libi386/pxe.c index 8391bb8..5cbf545 100644 --- a/sys/boot/i386/libi386/pxe.c +++ b/sys/boot/i386/libi386/pxe.c @@ -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); } |