svn commit: r246031 - user/sbruno/head_146698/sys/boot/i386/pxe_http
Sean Bruno
sbruno at FreeBSD.org
Mon Jan 28 12:50:17 UTC 2013
Author: sbruno
Date: Mon Jan 28 12:50:16 2013
New Revision: 246031
URL: http://svnweb.freebsd.org/changeset/base/246031
Log:
Construct URL such that there is no // at the beginning of the request but
still respect the contents of libstand::rootpath[]
Update PXE_IP_WWW if we are using libstand code for bootp (at least that's
what I think its doing here).
Modified:
user/sbruno/head_146698/sys/boot/i386/pxe_http/pxe_core.c
user/sbruno/head_146698/sys/boot/i386/pxe_http/pxe_dhcp.c
Modified: user/sbruno/head_146698/sys/boot/i386/pxe_http/pxe_core.c
==============================================================================
--- user/sbruno/head_146698/sys/boot/i386/pxe_http/pxe_core.c Mon Jan 28 12:20:20 2013 (r246030)
+++ user/sbruno/head_146698/sys/boot/i386/pxe_http/pxe_core.c Mon Jan 28 12:50:16 2013 (r246031)
@@ -142,6 +142,17 @@ pxe_core_update_bootp()
setenv("boot.nfsroot.server", inet_ntoa(tmp_in), 1);
setenv("boot.nfsroot.path", rootpath, 1);
#endif
+ /* removing '/' at tail of rootpath */
+ size_t rlen = strlen(rootpath);
+ if ( (rlen > 0) && (rootpath[rlen - 1] == '/'))
+ rootpath[rlen - 1] = '\0';
+
+ /* check if Web server option specified,
+ * if not, make it equal to root ip
+ */
+ if (pxe_get_ip(PXE_IP_WWW)->ip == 0) {
+ pxe_set_ip(PXE_IP_WWW, pxe_get_ip(PXE_IP_ROOT));
+ }
}
/* pxe_core_init() - performs initialization of all PXE related code
Modified: user/sbruno/head_146698/sys/boot/i386/pxe_http/pxe_dhcp.c
==============================================================================
--- user/sbruno/head_146698/sys/boot/i386/pxe_http/pxe_dhcp.c Mon Jan 28 12:20:20 2013 (r246030)
+++ user/sbruno/head_146698/sys/boot/i386/pxe_http/pxe_dhcp.c Mon Jan 28 12:50:16 2013 (r246031)
@@ -441,6 +441,7 @@ pxe_dhcp_query(uint32_t xid)
addr.ip = rootip.s_addr;
pxe_set_ip(PXE_IP_ROOT, &addr);
+ pxe_set_ip(PXE_IP_WWW, &addr);
/* "network route". direct connect for those addresses */
pxe_ip_route_add(pxe_get_ip(PXE_IP_MY), netmask, NULL);
More information about the svn-src-user
mailing list