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 issues with ares_getaddrinfo()

From: Peter Krefting via curl-library <>
Date: Mon, 23 Jan 2023 11:08:34 +0100 (CET)


> I guess it will help if you provide full Curl verbose output for both cases, otherwise, it is not clear if the resolution was the same.
> For example, ares_getaddrinfo() might give IPv6 name resolution vs IPv4 one when using the old approach.

Interestingly enough, I am not able to duplicate the issue when using
the curl binary any longer; in my initial testing also calling through
the curl binary failed, several recompiles later that is not the case.
Using the unpatched file does still fail my testing binary,
so there might be some setup that differ.

>> I'm not sure how to do that, sorry.
> You can use the CURLOPT_INTERFACE option. It gives the ability to specify the network interface by IP address.

Setting it to "host!" and the IPv6 address of each interface (2a06...)
gives me a "failed to connect: Error" (28) after a timeout, for all
connections, the same that I get for HTTPS when not specifying. Using
"if!eth0" gives me the same, whereas "if!eth1" does succeed to go
through (with IPv4, I assume). Using "host!" and the IPv4 address of
each interface succeeds.

So, in summary:

  iface | host!IPv6 | host!IPv4 | if!name
  eth0 | error | OK | error
  eth1 | error | OK | OK
  eth2 | error | OK | error

libcurl reports (strerror [CURLcode]: CURL_ERRORBUFFER):
"Error [28]: Failed to connect to port 80 after 15201 ms: Error"

\\// Peter -
Received on 2023-01-23