mirror of https://github.com/ipxe/ipxe.git
[tftp] Avoid setting current working URI to "tftp://0.0.0.0/"
Set the current working URI to NULL rather than to "tftp://0.0.0.0/". Reported-by: Piotr Jaroszyński <p.jaroszynski@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>pull/1/head
parent
748d5ed9da
commit
58dcb2e15e
|
@ -1245,11 +1245,15 @@ static int tftp_apply_settings ( void ) {
|
|||
* applicators.
|
||||
*/
|
||||
if ( tftp_server.s_addr != last_tftp_server.s_addr ) {
|
||||
snprintf ( uri_string, sizeof ( uri_string ),
|
||||
"tftp://%s/", inet_ntoa ( tftp_server ) );
|
||||
uri = parse_uri ( uri_string );
|
||||
if ( ! uri )
|
||||
return -ENOMEM;
|
||||
if ( tftp_server.s_addr ) {
|
||||
snprintf ( uri_string, sizeof ( uri_string ),
|
||||
"tftp://%s/", inet_ntoa ( tftp_server ) );
|
||||
uri = parse_uri ( uri_string );
|
||||
if ( ! uri )
|
||||
return -ENOMEM;
|
||||
} else {
|
||||
uri = NULL;
|
||||
}
|
||||
churi ( uri );
|
||||
uri_put ( uri );
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue