cURL / Mailing Lists / curl-library / Single Mail

curl-library

[ares] ipv6: Fix some build issues related to the local-bind feature.

From: Ben Greear <greearb_at_candelatech.com>
Date: Thu, 29 Jul 2010 08:24:59 -0700

Signed-off-by: Ben Greear <greearb_at_candelatech.com>

---
:100644 100644 c0365c4... 6f1022a... M	ares_ipv6.h
:100644 100644 bb1d5d5... 1de36c4... M	ares_options.c
:100644 100644 14dce71... c3d7fa4... M	ares_process.c
:100644 100644 eabf63b... 8e8a42c... M	inet_net_pton.c
 ares_ipv6.h     |    4 ++++
 ares_options.c  |    5 +----
 ares_process.c  |    2 +-
 inet_net_pton.c |    4 ++++
 4 files changed, 10 insertions(+), 5 deletions(-)
diff --git a/ares_ipv6.h b/ares_ipv6.h
index c0365c4..6f1022a 100644
--- a/ares_ipv6.h
+++ b/ares_ipv6.h
@@ -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 */
diff --git a/ares_options.c b/ares_options.c
index bb1d5d5..1de36c4 100644
--- a/ares_options.c
+++ b/ares_options.c
@@ -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;
diff --git a/ares_process.c b/ares_process.c
index 14dce71..c3d7fa4 100644
--- a/ares_process.c
+++ b/ares_process.c
@@ -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;
diff --git a/inet_net_pton.c b/inet_net_pton.c
index eabf63b..8e8a42c 100644
--- a/inet_net_pton.c
+++ b/inet_net_pton.c
@@ -46,6 +46,10 @@
 #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)
 
 /*
-- 
1.6.2.5
--------------060306030306050906000906
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
--------------060306030306050906000906--
Received on 2001-09-17