aboutsummaryrefslogtreecommitdiff
path: root/src/usr
diff options
context:
space:
mode:
authorMichael Brown <mcb30@ipxe.org>2011-02-01 04:25:38 +0000
committerMichael Brown <mcb30@ipxe.org>2011-02-01 04:26:19 +0000
commit88b8aa0f6554d6284a72e8e7b8c68572e35e3a61 (patch)
tree3a132daf626cdfa08928e87e0a238c35baa810c9 /src/usr
parentd77b183f103227bb67b300017add920ab14f6912 (diff)
downloadipxe-88b8aa0f6554d6284a72e8e7b8c68572e35e3a61.zip
ipxe-88b8aa0f6554d6284a72e8e7b8c68572e35e3a61.tar.gz
ipxe-88b8aa0f6554d6284a72e8e7b8c68572e35e3a61.tar.bz2
[autoboot] Cope properly with empty DHCP filenames
This (hopefully) fixes a regression introduced in commit e088892 ("[autoboot] Connect SAN disk during a filename boot, if applicable"). Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/usr')
-rw-r--r--src/usr/autoboot.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/usr/autoboot.c b/src/usr/autoboot.c
index 20c67f3..bb7d692 100644
--- a/src/usr/autoboot.c
+++ b/src/usr/autoboot.c
@@ -81,11 +81,11 @@ static struct uri * parse_next_server_and_filename ( struct in_addr next_server,
* filenames with and without initial slashes, which is
* significant for TFTP.
*/
- if ( ! uri_is_absolute ( uri ) ) {
+ if ( next_server.s_addr && filename[0] && ! uri_is_absolute ( uri ) ) {
uri_put ( uri );
snprintf ( buf, sizeof ( buf ), "tftp://%s/%s",
inet_ntoa ( next_server ), filename );
- uri = parse_uri ( filename );
+ uri = parse_uri ( buf );
if ( ! uri )
return NULL;
}
@@ -130,7 +130,7 @@ int uriboot ( struct uri *filename, struct uri *root_path ) {
}
/* Treat empty URIs as absent */
- if ( filename && ( ! filename->path ) )
+ if ( filename && ( ! uri_has_path ( filename ) ) )
filename = NULL;
if ( root_path && ( ! uri_is_absolute ( root_path ) ) )
root_path = NULL;