Parcourir la source

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

tags/v0.9.3
Michael Brown il y a 17 ans
Parent
révision
e708137029
1 fichiers modifiés avec 5 ajouts et 2 suppressions
  1. 5
    2
      src/usr/dhcpmgmt.c

+ 5
- 2
src/usr/dhcpmgmt.c Voir le fichier

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

Chargement…
Annuler
Enregistrer