curl / Mailing Lists / curl-library / Single Mail
Buy commercial curl support from WolfSSL. We help you work out your issues, debug your libcurl applications, use the API, port to new platforms, add new features and more. With a team lead by the curl founder himself.

RE: IPv6 resolution problems for IPv4 resolve mode

From: Daniel Stenberg via curl-library <curl-library_at_lists.haxx.se>
Date: Sun, 10 Jul 2022 00:14:26 +0200 (CEST)

On Thu, 7 Jul 2022, Dmitry Karpov via curl-library wrote:

> So, the intent described in the statement "It is important that *all*
> addresses versions are resolved, even if not used..." from 84d2839740ca7804
> will cause transfer timeouts for IPv4-only resolution mode in case of
> bad/missing AAAA responses.

I would rather say that it *may* cause timouts, as it certainly is not how
things *should* work.

Your patch looks like it might work. I'm still mostly concerned that this
takes us back in behavior a little bit and that it will make someone else not
like that and come here in a few montths with an issue about it.

Wouldn't it be better if we add a bit to the CURLOPT_IPRESOLVE option that
says something like "enforce this in name resolve too" ? Like:

#define CURL_IPRESOLVE_ALSO_RESOLVE 0x10 /* name to be debated */

to be used like this:

   curl_easy_setopt(c, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4 |
                                          CURL_IPRESOLVE_ALSO_RESOLVE );

... which then makes the name resolve for this transfer also just ask for IPv4
and the connect only be done using IPv4?

Maybe even make the DNS cache use family preference as a key for lookups so
that we have separate IPv6-only and IPv4-only results in memory for the same
host?

-- 
  / daniel.haxx.se
  | Commercial curl support up to 24x7 is available!
  | Private help, bug fixes, support, ports, new features
  | https://curl.se/support.html
-- 
Unsubscribe: https://lists.haxx.se/listinfo/curl-library
Etiquette:   https://curl.se/mail/etiquette.html
Received on 2022-07-10