mirror of
https://github.com/curl/curl.git
synced 2026-08-26 02:13:33 +03:00
curl_setup: disable IPv6 resolver without getaddrinfo
Also, use `CURLRES_IPV6` only for actual DNS resolution, not for IPv6 address support. This makes it possible to connect to IPv6 literals by setting `ENABLE_IPV6` even without `getaddrinfo` support. It also fixes the CMake build when using the synchronous resolver without `getaddrinfo` support. Closes https://github.com/curl/curl/pull/4662
This commit is contained in:
parent
ab712afa8f
commit
67a08dca27
4 changed files with 26 additions and 6 deletions
|
|
@ -68,7 +68,7 @@ int main(int argc, char *argv[])
|
|||
while(argc>arg) {
|
||||
if(!strcmp("--version", argv[arg])) {
|
||||
printf("resolve IPv4%s\n",
|
||||
#ifdef ENABLE_IPV6
|
||||
#if defined(CURLRES_IPV6)
|
||||
"/IPv6"
|
||||
#else
|
||||
""
|
||||
|
|
@ -95,7 +95,7 @@ int main(int argc, char *argv[])
|
|||
puts("Usage: resolve [option] <host>\n"
|
||||
" --version\n"
|
||||
" --ipv4"
|
||||
#ifdef ENABLE_IPV6
|
||||
#if defined(CURLRES_IPV6)
|
||||
"\n --ipv6"
|
||||
#endif
|
||||
);
|
||||
|
|
@ -107,7 +107,7 @@ int main(int argc, char *argv[])
|
|||
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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue