From 4e3976711dec26ba1f462f19c4b865dea3dbe4d7 Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Thu, 18 Jan 2007 22:38:13 +0000 Subject: A working name resolution framework --- src/usr/dhcpmgmt.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/usr') diff --git a/src/usr/dhcpmgmt.c b/src/usr/dhcpmgmt.c index 6f0302741..42a0f2b79 100644 --- a/src/usr/dhcpmgmt.c +++ b/src/usr/dhcpmgmt.c @@ -24,6 +24,7 @@ #include #include #include +#include #include #include @@ -33,6 +34,9 @@ * */ +/* Avoid dragging in dns.o */ +struct in_addr nameserver; + /** * Configure network device via DHCP * @@ -42,8 +46,8 @@ int dhcp ( struct net_device *netdev ) { static struct dhcp_option_block *dhcp_options = NULL; struct dhcp_session dhcp; - struct in_addr address = { htonl ( 0 ) }; - struct in_addr netmask = { htonl ( 0 ) }; + struct in_addr address = { 0 }; + struct in_addr netmask = { 0 }; struct in_addr gateway = { INADDR_NONE }; struct async async; int rc; @@ -90,5 +94,9 @@ int dhcp ( struct net_device *netdev ) { return rc; } + /* Retrieve other DHCP options that we care about */ + find_dhcp_ipv4_option ( dhcp_options, DHCP_DNS_SERVERS, + &nameserver ); + return 0; } -- cgit v1.2.3-55-g7522