From 3e33e2c2ba612d19cf7c1f77c8953b012489e801 Mon Sep 17 00:00:00 2001 From: Ben Greear Date: Thu, 29 Jul 2010 08:24:59 -0700 Subject: ipv6: Fix some build issues related to the local-bind feature. Signed-off-by: Ben Greear --- 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) /* -- cgit v1.2.3