diff options
author | Michael Brown | 2008-03-21 23:15:31 +0100 |
---|---|---|
committer | Michael Brown | 2008-03-21 23:15:31 +0100 |
commit | 8afb36c3bc08ff0c9bdf0a8496cb08a8bfe287f3 (patch) | |
tree | 4369c087ca4c75593fe6d287fca658516d20a9d8 /src/usr/dhcpmgmt.c | |
parent | [DHCP] Kill off some no-longer-used DHCP functions (diff) | |
download | ipxe-8afb36c3bc08ff0c9bdf0a8496cb08a8bfe287f3.tar.gz ipxe-8afb36c3bc08ff0c9bdf0a8496cb08a8bfe287f3.tar.xz ipxe-8afb36c3bc08ff0c9bdf0a8496cb08a8bfe287f3.zip |
[Settings] Migrate DHCP and NVO code to the new settings API (untested)
Diffstat (limited to 'src/usr/dhcpmgmt.c')
-rw-r--r-- | src/usr/dhcpmgmt.c | 23 |
1 files changed, 5 insertions, 18 deletions
diff --git a/src/usr/dhcpmgmt.c b/src/usr/dhcpmgmt.c index 39fe9207..d638bd4a 100644 --- a/src/usr/dhcpmgmt.c +++ b/src/usr/dhcpmgmt.c @@ -32,16 +32,8 @@ * */ -static int dhcp_success ( struct net_device *netdev __unused, - struct dhcp_option_block *options ) { - DBGC ( options, "DHCP client registering options %p\n", options ); - register_dhcp_options ( options ); - return 0; -} - int dhcp ( struct net_device *netdev ) { - struct dhcp_option_block *options; - struct dhcp_option_block *tmp; + struct settings *settings; int rc; /* Check we can open the interface first */ @@ -49,18 +41,13 @@ int dhcp ( struct net_device *netdev ) { return rc; /* Unregister any option blocks acquired via DHCP */ - list_for_each_entry_safe ( options, tmp, &dhcp_option_blocks, list ) { - /* Skip static option blocks (e.g. from NVS) */ - if ( find_dhcp_option ( options, DHCP_MESSAGE_TYPE ) ) { - DBGC ( options, "DHCP client unregistering options " - "%p\n", options ); - unregister_dhcp_options ( options ); - } - } + settings = find_child_settings ( netdev_settings ( netdev ), "dhcp" ); + if ( settings ) + unregister_settings ( settings ); /* Perform DHCP */ printf ( "DHCP (%s %s)", netdev->name, netdev_hwaddr ( netdev ) ); - if ( ( rc = start_dhcp ( &monojob, netdev, dhcp_success ) ) == 0 ) + if ( ( rc = start_dhcp ( &monojob, netdev ) ) == 0 ) rc = monojob_wait ( "" ); return rc; |