cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: libcurl issue with IPv6 and c-ares

From: Phil Blundell <pb_at_reciva.com>
Date: Sat, 11 Oct 2008 18:12:00 +0100

On Thu, 2008-10-09 at 12:03 -0400, Daniel Johnson wrote:
> Maybe it would be safer to default to PF_INET instead? That's what I
> did locally, by deleting the "default:" line. That way one can still
> explicitly ask for IPv6, but IPv4 will be used normally. Ultimately, c-
> ares should probably be enhanced to better match the behavior of
> getaddrinfo, but I'm already a bit over my head here. :)

You're right that the current behaviour does not look ideal, but
changing the default from PF_INET6 to PF_INET would just swap one
problem for another. This change would make it impossible for
libcurl-using applications to connect to v6-only hosts, since a PF_INET
lookup will just return ARES_NODATA for hosts with only AAAA records.

Making c-ares support AF_UNSPEC would certainly be the ideal thing.
Unfortunately this looks like it would be quite a lot of work: the
internal arrangement of the ares code is not particularly amenable to
returning a mixture of AF_INET and AF_INET6 results for a single query.
>From a pragmatic point of view it might be easier to teach libcurl to
make two separate ares queries in this case. Would you like to try
making a patch for that?

p.
Received on 2008-10-11