kczekirda updated this revision to Diff 27744.

CHANGES SINCE LAST UPDATE
  https://reviews.freebsd.org/D10485?vs=27699&id=27744

REVISION DETAIL
  https://reviews.freebsd.org/D10485

AFFECTED FILES
  /usr/src/lib/libstand/bootp.c
  /usr/src/lib/libstand/bootp.h
  /usr/src/sys/boot/i386/libi386/pxe.c

EMAIL PREFERENCES
  https://reviews.freebsd.org/settings/panel/emailpreferences/

To: kczekirda, bapt, oshogbo, tsoome, sbruno, #network, freebsd-net-list, imp
Cc: rgrimes, garga, ler, asomers
diff --git a//usr/src/sys/boot/i386/libi386/pxe.c b//usr/src/sys/boot/i386/libi386/pxe.c
--- a//usr/src/sys/boot/i386/libi386/pxe.c
+++ b//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)
diff --git a//usr/src/lib/libstand/bootp.c b//usr/src/lib/libstand/bootp.c
--- a//usr/src/lib/libstand/bootp.c
+++ b//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;
diff --git a//usr/src/lib/libstand/bootp.h b//usr/src/lib/libstand/bootp.h
--- a//usr/src/lib/libstand/bootp.h
+++ b//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)

_______________________________________________
freebsd-net@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-net
To unsubscribe, send any mail to "freebsd-net-unsubscr...@freebsd.org"

Reply via email to