diff options
Diffstat (limited to 'src/net/udp')
| -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; -} |
