mirror of
https://github.com/ipxe/ipxe
synced 2025-12-26 01:22:37 +03:00
[Settings] Use a settings applicator to set the default TFTP URI.
This commit is contained in:
@@ -284,8 +284,6 @@ void register_dhcp_options ( struct dhcp_option_block *options ) {
|
||||
dhcpopt_get ( options );
|
||||
list_add_tail ( &options->list, &existing->list );
|
||||
|
||||
/* Apply all registered DHCP options */
|
||||
apply_global_dhcp_options();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -564,36 +562,3 @@ void delete_dhcp_option ( struct dhcp_option_block *options,
|
||||
unsigned int tag ) {
|
||||
set_dhcp_option ( options, tag, NULL, 0 );
|
||||
}
|
||||
|
||||
/**
|
||||
* Apply DHCP options
|
||||
*
|
||||
* @v options DHCP options block, or NULL
|
||||
* @ret rc Return status code
|
||||
*/
|
||||
int apply_dhcp_options ( struct dhcp_option_block *options ) {
|
||||
struct in_addr tftp_server;
|
||||
struct uri *uri;
|
||||
char uri_string[32];
|
||||
|
||||
/* Set current working URI based on TFTP server */
|
||||
find_dhcp_ipv4_option ( options, DHCP_EB_SIADDR, &tftp_server );
|
||||
snprintf ( uri_string, sizeof ( uri_string ),
|
||||
"tftp://%s/", inet_ntoa ( tftp_server ) );
|
||||
uri = parse_uri ( uri_string );
|
||||
if ( ! uri )
|
||||
return -ENOMEM;
|
||||
churi ( uri );
|
||||
uri_put ( uri );
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Apply global DHCP options
|
||||
*
|
||||
* @ret rc Return status code
|
||||
*/
|
||||
int apply_global_dhcp_options ( void ) {
|
||||
return apply_dhcp_options ( NULL );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user