Browse Source

DNS code now records a whole struct sockaddr for the name server.

tags/v0.9.3
Michael Brown 17 years ago
parent
commit
e708137029
1 changed files with 5 additions and 2 deletions
  1. 5
    2
      src/usr/dhcpmgmt.c

+ 5
- 2
src/usr/dhcpmgmt.c View File

35
  */
35
  */
36
 
36
 
37
 /* Avoid dragging in dns.o */
37
 /* Avoid dragging in dns.o */
38
-struct in_addr nameserver;
38
+struct sockaddr_tcpip nameserver;
39
 
39
 
40
 /* Avoid dragging in syslog.o */
40
 /* Avoid dragging in syslog.o */
41
 struct in_addr syslogserver;
41
 struct in_addr syslogserver;
52
 	struct in_addr address = { 0 };
52
 	struct in_addr address = { 0 };
53
 	struct in_addr netmask = { 0 };
53
 	struct in_addr netmask = { 0 };
54
 	struct in_addr gateway = { INADDR_NONE };
54
 	struct in_addr gateway = { INADDR_NONE };
55
+	struct sockaddr_in *sin_nameserver;
55
 	struct async async;
56
 	struct async async;
56
 	int rc;
57
 	int rc;
57
 
58
 
98
 	}
99
 	}
99
 
100
 
100
 	/* Retrieve other DHCP options that we care about */
101
 	/* Retrieve other DHCP options that we care about */
102
+	sin_nameserver = ( struct sockaddr_in * ) &nameserver;
103
+	sin_nameserver->sin_family = AF_INET;
101
 	find_dhcp_ipv4_option ( dhcp_options, DHCP_DNS_SERVERS,
104
 	find_dhcp_ipv4_option ( dhcp_options, DHCP_DNS_SERVERS,
102
-				&nameserver );
105
+				&sin_nameserver->sin_addr );
103
 	find_dhcp_ipv4_option ( dhcp_options, DHCP_LOG_SERVERS,
106
 	find_dhcp_ipv4_option ( dhcp_options, DHCP_LOG_SERVERS,
104
 				&syslogserver );
107
 				&syslogserver );
105
 
108
 

Loading…
Cancel
Save