ipv6: Fix some build issues related to the local-bind feature.
authorBen Greear <greearb@candelatech.com>
Thu, 29 Jul 2010 15:24:59 +0000 (08:24 -0700)
committerBen Greear <greearb@candelatech.com>
Fri, 30 Jul 2010 05:31:56 +0000 (22:31 -0700)
Signed-off-by: Ben Greear <greearb@candelatech.com>
ares_ipv6.h
ares_options.c
ares_process.c
inet_net_pton.c

index c0365c4..6f1022a 100644 (file)
@@ -71,4 +71,8 @@ struct addrinfo
 #endif
 #endif
 
+/* Defined in ares_net_pton.c for no particular reason. */
+extern const struct ares_in6_addr ares_in6addr_any; /* :: */
+
+
 #endif /* ARES_IPV6_H */
index bb1d5d5..1de36c4 100644 (file)
@@ -131,8 +131,6 @@ int ares_set_servers(ares_channel channel,
 int ares_set_servers_csv(ares_channel channel,
                          const char* _csv)
 {
-  struct ares_addr_node *srvr;
-  int num_srvrs = 0;
   int i;
   char* csv = NULL;
   char* ptr;
@@ -162,10 +160,9 @@ int ares_set_servers_csv(ares_channel channel,
     csv[i+1] = 0;
   }
 
-  ptr = csv;
   start_host = csv;
   found_port = false;
-  for (ptr; *ptr; ptr++) {
+  for (ptr = csv; *ptr; ptr++) {
     if (*ptr == ',') {
       char* pp = ptr - 1;
       struct in_addr in4;
index 14dce71..c3d7fa4 100644 (file)
@@ -912,7 +912,7 @@ static int configure_socket(ares_socket_t s, int family, ares_channel channel)
     }
   }
   else if (family == AF_INET6) {
-    if (memcmp(channel->local_ip6, &in6addr_any, sizeof(channel->local_ip6)) != 0) {
+    if (memcmp(channel->local_ip6, &ares_in6addr_any, sizeof(channel->local_ip6)) != 0) {
       struct sockaddr_in6 sa;
       memset(&sa, 0, sizeof(sa));
       sa.sin6_family = AF_INET6;
index eabf63b..8e8a42c 100644 (file)
 #include "ares_ipv6.h"
 #include "inet_net_pton.h"
 
+
+const struct ares_in6_addr ares_in6addr_any = { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } } };
+
+
 #if !defined(HAVE_INET_NET_PTON) || !defined(HAVE_INET_NET_PTON_IPV6)
 
 /*