2
0
mirror of https://github.com/xcat2/xNBA.git synced 2026-04-28 15:37:48 +00:00

Implement variable expansion on the filename field from dhcp

This commit is contained in:
Jarrod Johnson
2011-01-07 16:44:14 -05:00
parent 713103876e
commit 9318287f5a
2 changed files with 5 additions and 2 deletions

View File

@@ -95,7 +95,7 @@ int execv ( const char *command, char * const argv[] ) {
* The expanded command line is allocated with malloc() and the caller
* must eventually free() it.
*/
static char * expand_command ( const char *command ) {
char * expand_command ( const char *command ) {
char *expcmd;
char *start;
char *end;

View File

@@ -33,6 +33,7 @@ FILE_LICENCE ( GPL2_OR_LATER );
#include <usr/dhcpmgmt.h>
#include <usr/imgmgmt.h>
#include <usr/autoboot.h>
char * expand_command ( const char *command );
/** @file
*
@@ -97,7 +98,9 @@ int boot_next_server_and_filename ( struct in_addr next_server,
uri_encode ( filename, buf + strlen ( buf ),
sizeof ( buf ) - strlen ( buf ), URI_PATH );
filename = buf;
}
} else { /* I don't think it could hurt the tftp case, but might as well stay out of a codepath I don't intend to rigorously test */
filename = expand_command(filename);
}
/* Download and boot image */
image = alloc_image();