Subject: [PATCH] Less bad AF_UNSPEC treatment

[PATCH] Less bad AF_UNSPEC treatment

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Thu, 29 Jan 2009 23:37:55 +0100 (CET)

Hey

I've grown tired of having a test case in curl fail because c-ares can't
properly "resolve" an ipv6 host specified in /etc/hosts. Like:

::1 ip6-localhost

So I wrote up a patch for c-ares that makes ares_gethostbyname() accept
AF_UNSPEC as family. It will then accept ipv4 _or_ ipv6 names in files. I call
it "less bad" in the subject since it still does type A resolves then without
resorting to trying AAAA ones when this is specified.

However I think that minor flaw is also rather easy fixable now. I'm open for
comments on this patch anyway.

As a bonus I threw in my little patch that makes libcurl take advantage of
this improved c-ares thing as with both these patches applied curl test case
241 runs fine for me!

-- 
  / daniel.haxx.se


Received on 2009-01-29