aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2009-01-31 20:25:55 +0000
committerDaniel Stenberg <daniel@haxx.se>2009-01-31 20:25:55 +0000
commitdcf92bffd2a22909a44b45bd7490e2575e14f82c (patch)
treebac149118b9b72f7d144af622b2d4a1346841974 /lib
parenta2256e899b7c122169b9c50e8cb92ac6fc51e95b (diff)
- When building with c-ares 1.6.1 (not yet released) or later and IPv6 support
enabled, we can now take advantage of its brand new AF_UNSPEC support in ares_gethostbyname(). This makes test case 241 finally run fine for me wtih this setup since it now parses the "::1 ip6-localhost" line fine in my /etc/hosts file!
Diffstat (limited to 'lib')
-rw-r--r--lib/hostares.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/lib/hostares.c b/lib/hostares.c
index 1f49b6784..708af4e86 100644
--- a/lib/hostares.c
+++ b/lib/hostares.c
@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2008, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2009, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
@@ -326,11 +326,14 @@ Curl_addrinfo *Curl_getaddrinfo(struct connectdata *conn,
}
switch(data->set.ip_version) {
+ default:
+#if ARES_VERSION >= 0x010601
+ family = PF_UNSPEC; /* supported by c-ares since 1.6.1, so for older
+ c-ares versions this just falls through and defaults
+ to PF_INET */
+ break;
+#endif
case CURL_IPRESOLVE_V4:
- default: /* By default we try ipv4, as PF_UNSPEC isn't supported by c-ares.
- This is a bit disturbing since users may very well assume that
- both kinds of addresses are asked for, but the problem is really
- in c-ares' end here. */
family = PF_INET;
break;
case CURL_IPRESOLVE_V6: