|
@@ -66,8 +66,9 @@ static struct net_device * find_boot_netdev ( void ) {
|
66
|
66
|
*/
|
67
|
67
|
static struct uri * parse_next_server_and_filename ( struct in_addr next_server,
|
68
|
68
|
const char *filename ) {
|
|
69
|
+ char buf[ 23 /* "tftp://xxx.xxx.xxx.xxx/" */ + strlen ( filename )
|
|
70
|
+ + 1 /* NUL */ ];
|
69
|
71
|
struct uri *uri;
|
70
|
|
- struct uri *tmp;
|
71
|
72
|
|
72
|
73
|
/* Parse filename */
|
73
|
74
|
uri = parse_uri ( filename );
|
|
@@ -81,11 +82,10 @@ static struct uri * parse_next_server_and_filename ( struct in_addr next_server,
|
81
|
82
|
* significant for TFTP.
|
82
|
83
|
*/
|
83
|
84
|
if ( ! uri_is_absolute ( uri ) ) {
|
84
|
|
- tmp = uri;
|
85
|
|
- tmp->scheme = "tftp";
|
86
|
|
- tmp->host = inet_ntoa ( next_server );
|
87
|
|
- uri = uri_dup ( tmp );
|
88
|
|
- uri_put ( tmp );
|
|
85
|
+ uri_put ( uri );
|
|
86
|
+ snprintf ( buf, sizeof ( buf ), "tftp://%s/%s",
|
|
87
|
+ inet_ntoa ( next_server ), filename );
|
|
88
|
+ uri = parse_uri ( filename );
|
89
|
89
|
if ( ! uri )
|
90
|
90
|
return NULL;
|
91
|
91
|
}
|