diff options
author | Michael Brown <mcb30@etherboot.org> | 2008-03-21 00:01:27 +0000 |
---|---|---|
committer | Michael Brown <mcb30@etherboot.org> | 2008-03-21 00:01:27 +0000 |
commit | aec9b8a41b6cad1b257c4e3a7f043f35871aafd0 (patch) | |
tree | d75b982ed496f3f5142f5b6c02fcbd3cea868f6e /src/net/udp/dhcp.c | |
parent | eae6ac3d0bdb5f25193af9584db4eec9dd5226c9 (diff) | |
download | ipxe-aec9b8a41b6cad1b257c4e3a7f043f35871aafd0.tar.gz |
[Settings] Use a settings applicator to configure IPv4 routes.
Diffstat (limited to 'src/net/udp/dhcp.c')
-rw-r--r-- | src/net/udp/dhcp.c | 43 |
1 files changed, 0 insertions, 43 deletions
diff --git a/src/net/udp/dhcp.c b/src/net/udp/dhcp.c index 2cb258e43..1beabb98c 100644 --- a/src/net/udp/dhcp.c +++ b/src/net/udp/dhcp.c @@ -1025,46 +1025,3 @@ int start_dhcp ( struct job_interface *job, struct net_device *netdev, ref_put ( &dhcp->refcnt ); return rc; } - -/**************************************************************************** - * - * Network device configurator - * - */ - -/** - * Configure network device from DHCP options - * - * @v netdev Network device - * @v options DHCP options block - * @ret rc Return status code - */ -int dhcp_configure_netdev ( struct net_device *netdev, - struct dhcp_option_block *options ) { - struct in_addr address = { 0 }; - struct in_addr netmask = { 0 }; - struct in_addr gateway = { INADDR_NONE }; - int rc; - - /* Retrieve IP address configuration */ - find_dhcp_ipv4_option ( options, DHCP_EB_YIADDR, &address ); - find_dhcp_ipv4_option ( options, DHCP_SUBNET_MASK, &netmask ); - find_dhcp_ipv4_option ( options, DHCP_ROUTERS, &gateway ); - - /* Do nothing unless we have at least an IP address to use */ - if ( ! address.s_addr ) - return 0; - - /* Clear any existing routing table entry */ - del_ipv4_address ( netdev ); - - /* Set up new IP address configuration */ - if ( ( rc = add_ipv4_address ( netdev, address, netmask, - gateway ) ) != 0 ) { - DBG ( "Could not configure %s with DHCP results: %s\n", - netdev->name, strerror ( rc ) ); - return rc; - } - - return 0; -} |