diff options
author | Jay Satiro <raysatiro@yahoo.com> | 2020-03-14 02:19:04 -0400 |
---|---|---|
committer | Jay Satiro <raysatiro@yahoo.com> | 2020-03-14 19:07:05 -0400 |
commit | 3bfda07004a5739fb306e55cb9529ba3de35fbdb (patch) | |
tree | d7f1e22dc2dc52801aab4496eefcb49d7223f917 | |
parent | 0845ecbb6dcaadad4a4891f7e85efb8c8e626ff6 (diff) | |
download | curl-3bfda07004a5739fb306e55cb9529ba3de35fbdb.tar.gz |
easy: Fix curl_easy_duphandle for builds missing IPv6 that use c-ares
- Ignore CURLE_NOT_BUILT_IN errors returned by c-ares functions in
curl_easy_duphandle.
Prior to this change if c-ares was used as the resolver backend and
either it was too old or libcurl was built without IPv6 support then
some of our resolver functions could return CURLE_NOT_BUILT_IN to
curl_easy_duphandle causing it to fail.
Caused by c8f086b which shipped in 7.69.1.
Reported-by: Karl Chen
Fixes https://github.com/curl/curl/issues/5097
Closes https://github.com/curl/curl/pull/5100
-rw-r--r-- | lib/easy.c | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/lib/easy.c b/lib/easy.c index b648e80c1..d08c6066c 100644 --- a/lib/easy.c +++ b/lib/easy.c @@ -884,14 +884,25 @@ struct Curl_easy *curl_easy_duphandle(struct Curl_easy *data) goto fail; #ifdef USE_ARES - if(Curl_set_dns_servers(outcurl, data->set.str[STRING_DNS_SERVERS])) - goto fail; - if(Curl_set_dns_interface(outcurl, data->set.str[STRING_DNS_INTERFACE])) - goto fail; - if(Curl_set_dns_local_ip4(outcurl, data->set.str[STRING_DNS_LOCAL_IP4])) - goto fail; - if(Curl_set_dns_local_ip6(outcurl, data->set.str[STRING_DNS_LOCAL_IP6])) - goto fail; + { + CURLcode rc; + + rc = Curl_set_dns_servers(outcurl, data->set.str[STRING_DNS_SERVERS]); + if(rc && rc != CURLE_NOT_BUILT_IN) + goto fail; + + rc = Curl_set_dns_interface(outcurl, data->set.str[STRING_DNS_INTERFACE]); + if(rc && rc != CURLE_NOT_BUILT_IN) + goto fail; + + rc = Curl_set_dns_local_ip4(outcurl, data->set.str[STRING_DNS_LOCAL_IP4]); + if(rc && rc != CURLE_NOT_BUILT_IN) + goto fail; + + rc = Curl_set_dns_local_ip6(outcurl, data->set.str[STRING_DNS_LOCAL_IP6]); + if(rc && rc != CURLE_NOT_BUILT_IN) + goto fail; + } #endif /* USE_ARES */ Curl_convert_setup(outcurl); |