summaryrefslogtreecommitdiffstats
path: root/src/usr/dhcpmgmt.c
diff options
context:
space:
mode:
authorMichael Brown2007-01-18 23:38:13 +0100
committerMichael Brown2007-01-18 23:38:13 +0100
commit4e3976711dec26ba1f462f19c4b865dea3dbe4d7 (patch)
treefab4b8042cdc2e01adc2b43f5f816611e5978068 /src/usr/dhcpmgmt.c
parentWhen an async operation dies, orphan its children. (diff)
downloadipxe-4e3976711dec26ba1f462f19c4b865dea3dbe4d7.tar.gz
ipxe-4e3976711dec26ba1f462f19c4b865dea3dbe4d7.tar.xz
ipxe-4e3976711dec26ba1f462f19c4b865dea3dbe4d7.zip
A working name resolution framework
Diffstat (limited to 'src/usr/dhcpmgmt.c')
-rw-r--r--src/usr/dhcpmgmt.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/usr/dhcpmgmt.c b/src/usr/dhcpmgmt.c
index 6f030274..42a0f2b7 100644
--- a/src/usr/dhcpmgmt.c
+++ b/src/usr/dhcpmgmt.c
@@ -24,6 +24,7 @@
#include <gpxe/dhcp.h>
#include <gpxe/async.h>
#include <gpxe/netdevice.h>
+#include <gpxe/dns.h>
#include <usr/ifmgmt.h>
#include <usr/dhcpmgmt.h>
@@ -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;
}