Subject: Re: [PATCH] Allow the use of IPv6 nameservers

Re: [PATCH] Allow the use of IPv6 nameservers

From: Yang Tse <>
Date: Fri, 19 Feb 2010 20:23:06 +0100

More nits...

Not all systems have in6_addr, that's the reason for having
ares_in6_addr in ares.h, so it would be convenient to move ares_addr
definition further down in ares.h and use ares_in6_addr in the
definition of the ares_addr struct. ares_set_nameservers() would also
need to be moved further down in taht header file.

If you expose definitions of addrV4 and addrV6 in ares.h these should
be 'ares' or cares' prefixed. Better just keep them in the private
part of the library and avoid the need to rename them.

It seems that you are using getaddrinfo() to validate an address
string, and that it makes no sense to feed it with a host name. Why
not use inet_addr() in a fisrt instance, this handles short hand IPv4
dot notation, and if it fails then use ares_inet_pton() which should
be capable of also handling IPv6 afterwards, getting rid of the call
to getaddrinfo()? Or am I overlooking something here?

There also seems to be some 'strange' memory management at the
beginning of set_nameserver()

Received on 2010-02-19