*waitp = 0; /* default to synchronous response */
+#ifdef ENABLE_IPV6
+ {
+ struct in6_addr in6;
+ /* check if this is an IPv6 address string */
+ if(Curl_inet_pton(AF_INET6, hostname, &in6) > 0)
+ /* This is an IPv6 address literal */
+ return Curl_ip2addr(AF_INET6, &in6, hostname, port);
+ }
+#endif /* ENABLE_IPV6 */
+
if(Curl_inet_pton(AF_INET, hostname, &in) > 0)
/* This is a dotted IP address 123.123.123.123-style */
return Curl_ip2addr(AF_INET, &in, hostname, port);
/* This is a dotted IP address 123.123.123.123-style */
return Curl_ip2addr(AF_INET, &in, hostname, port);
}
-#ifdef CURLRES_IPV6
+#ifdef ENABLE_IPV6
{
struct in6_addr in6;
/* check if this is an IPv6 address string */
/* This is an IPv6 address literal */
return Curl_ip2addr(AF_INET6, &in6, hostname, port);
}
-#endif /* CURLRES_IPV6 */
+#endif /* ENABLE_IPV6 */
#endif /* !USE_RESOLVE_ON_IPS */
#ifdef CURLRES_IPV6
struct in_addr in;
struct hostent *buf = NULL;
+#ifdef ENABLE_IPV6
+ {
+ struct in6_addr in6;
+ /* check if this is an IPv6 address string */
+ if(Curl_inet_pton(AF_INET6, hostname, &in6) > 0)
+ /* This is an IPv6 address literal */
+ return Curl_ip2addr(AF_INET6, &in6, hostname, port);
+ }
+#endif /* ENABLE_IPV6 */
+
if(Curl_inet_pton(AF_INET, hostname, &in) > 0)
/* This is a dotted IP address 123.123.123.123-style */
return Curl_ip2addr(AF_INET, &in, hostname, port);
while(argc>arg) {
if(!strcmp("--version", argv[arg])) {
printf("resolve IPv4%s\n",
-#ifdef ENABLE_IPV6
+#if defined(CURLRES_IPV6)
"/IPv6"
#else
""
puts("Usage: resolve [option] <host>\n"
" --version\n"
" --ipv4"
-#ifdef ENABLE_IPV6
+#if defined(CURLRES_IPV6)
"\n --ipv6"
#endif
);
atexit(win32_cleanup);
#endif
-#ifdef ENABLE_IPV6
+#if defined(CURLRES_IPV6)
if(use_ipv6) {
/* Check that the system has IPv6 enabled before checking the resolver */
curl_socket_t s = socket(PF_INET6, SOCK_DGRAM, 0);