Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
libcurl: 6765e6d breaks dns resolution in my setup with c-ares #4893
I did this
Curl compiled for arm with yocto like this:
curl version: 7.64.1
I expected the following
I do something like this:
I notice this when upgrading from libcurl 7.62 to 7.64. I took a guess and reverted 6765e6d and that made it work again.
Linux Yocto 2.7 kernel 4.14 armv7l
Can you be more specific? Can you deduct what causes the issue and produce a full demo source code that reproduces the issue for you when you run it? That way we would a good way to debug this. Simply reverting that commit is too crude and will only bring back the bug it fixed.
...doesn't work anymore, but:
new_handle = curl_easy_duphandle(curl_master);
Ok this was actually pretty easy to write a testcase for.
This is the output I expect:
However with 7.63+ I get:
Here it's forgotten all about my special DNS server.
curl_master = curl_easy_init(); curl_easy_setopt(curl_master, CURLOPT_URL, "https://curl.haxx.se/"); curl_easy_setopt(curl_master, CURLOPT_DNS_SERVERS, "220.127.116.11,18.104.22.168"); new_handle = curl_easy_duphandle(curl_master); ret = curl_easy_perform(new_handle);
Will simply use the default name server c-ares figures out, not the one set in the master handle.
Thus a simpler code that does the same thing is:
curl_master = curl_easy_init(); curl_easy_setopt(curl_master, CURLOPT_URL, "https://curl.haxx.se/"); ret = curl_easy_perform(curl_master);
I found the issue. You were of course right and I didn't dig deep enough until now.
In the commit that closed #3238, the code changed the the function Curl_resolver_duphandle() which previously used
In the fix, the code changed that to instead do a fresh
Now, for the best step to fix this I need to think a little...
I think this should be fixed by
What do you think @ernstp?