Page MenuHomeFreeBSD

D10485.diff
No OneTemporary

D10485.diff

Index: /usr/src/lib/libstand/bootp.h
===================================================================
--- /usr/src/lib/libstand/bootp.h
+++ /usr/src/lib/libstand/bootp.h
@@ -94,6 +94,9 @@
#define TAG_SWAPSERVER ((unsigned char) 16)
#define TAG_ROOTPATH ((unsigned char) 17)
#define TAG_INTF_MTU ((unsigned char) 26)
+#define TAG_TFTP_SERVER_NAME ((unsigned char) 66)
+
+#define VEND_INFO_END 0xff /* End option in RFC2132 */
#ifdef SUPPORT_DHCP
#define TAG_REQ_ADDR ((unsigned char) 50)
@@ -108,7 +111,6 @@
#define TAG_T2 ((unsigned char) 59)
#define TAG_CLASSID ((unsigned char) 60)
#define TAG_CLIENTID ((unsigned char) 61)
-#define TAG_TFTP_SERVER ((unsigned char) 150)
#endif
#define TAG_END ((unsigned char) 255)
Index: /usr/src/lib/libstand/bootp.c
===================================================================
--- /usr/src/lib/libstand/bootp.c
+++ /usr/src/lib/libstand/bootp.c
@@ -150,7 +150,7 @@
bp->bp_vend[18] = TAG_PARAM_REQ;
bp->bp_vend[19] = 8;
bp->bp_vend[20] = TAG_ROOTPATH;
- bp->bp_vend[21] = TAG_TFTP_SERVER;
+ bp->bp_vend[21] = TAG_TFTP_SERVER_NAME;
bp->bp_vend[22] = TAG_HOSTNAME;
bp->bp_vend[23] = TAG_SWAPSERVER;
bp->bp_vend[24] = TAG_GATEWAY;
@@ -365,6 +365,7 @@
int size;
u_char tag;
const char *val;
+ n_long ipaddr = INADDR_NONE;
#ifdef BOOTP_DEBUG
if (debug)
@@ -438,9 +439,10 @@
bcopy(cp, &dhcp_serverip.s_addr,
sizeof(dhcp_serverip.s_addr));
}
- if (tag == TAG_TFTP_SERVER) {
- bcopy(cp, &tftpip.s_addr,
- sizeof(tftpip.s_addr));
+ if (tag == TAG_TFTP_SERVER_NAME) {
+ val = strsep(&cp, VEND_INFO_END);
+ if ((ipaddr = inet_addr(val)) != INADDR_NONE)
+ tftpip.s_addr = ipaddr;
}
#endif
cp += size;
Index: /usr/src/sys/boot/i386/libi386/pxe.c
===================================================================
--- /usr/src/sys/boot/i386/libi386/pxe.c
+++ /usr/src/sys/boot/i386/libi386/pxe.c
@@ -297,9 +297,6 @@
printf("pxe_open: loaded RFC1048 data from PXE Cache\n");
}
-#ifdef LOADER_TFTP_SUPPORT
- bootp(pxe_sock, BOOTP_PXE);
-#endif
if (rootip.s_addr == 0)
rootip.s_addr = bootplayer.sip;
if (gateip.s_addr == 0)

File Metadata

Mime Type
text/plain
Expires
Mon, Apr 20, 5:41 AM (1 h, 4 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
31821652
Default Alt Text
D10485.diff (2 KB)

Event Timeline