Subject: Re: c-ares IPv6 support (preliminary patch)

Re: c-ares IPv6 support (preliminary patch)

From: codemastr <codemstr_at_ptd.net>
Date: 2005-03-08

> I figure this choice could be a subject of discussion. Personally I'd vote
> to keep compatibility with current c-ares and add support for IPv6 in a
> new function.
I think you might have misunderstood. The system is fully backwards
compatible. The signature of ares_gethostbyname/addr is:
void ares_gethostbyname(ares_channel channel, const char *name, int family,
ares_host_callback callback, void *arg)
void ares_gethostbyaddr(ares_channel channel, const void *addr, int addrlen,
int family, ares_host_callback callback, void *arg)

Note the "int family." In both of those functions, it did a check to make
sure family == AF_INET. I simply expanded it for the case where family ==
AF_INET6. Hence, if you continue to use the function with AF_INET, it will
work 100% like it does now, however if you use AF_INET6, then it will use
IPv6. In a sense, it works like the gethostbyname2 function.

> I think can do some rudimentary testing on Linux. At least for file-based
> lookups.
Well file based lookups aren't in the patch yet, however, I should have an
updated patch today that does support file lookups as well as some basic OS
independence (still no Windows support).

>> * IPv6 DNS server support. c-ares needs the ability to actually
>> communicate with the DNS server over IPv6.
>
> But this is possible to save for later, right?
Of course, we can add just lookup support first, then work on adding IPv6
connections. Also, this part, would require the OS to support IPv6 since
we'll be creating IPv6 sockets.

Also I had a question, maybe someone knows the answer to this. In
/etc/resolv.conf, how does the sortlist apply to IPv6? I tried using google,
and every single man page I found for resolv.conf includes the exact same
sample: "sortlist 130.155.160.0/255.255.240.0 130.155.0.0" note the lack of
any example using IPv6. Also, the man pages state that it uses netmasks,
well IPv6 doesn't, instead you have CIDR. Therefore, I have no idea if/how
sortlist would apply to IPv6. I do know, however, that I am no good when it
comes to CIDR and the only freely available CIDR IPv6 implementation I know
of is GPLed, so if CIDR is the way it works, someone else will need to
handle it most likely.

Dominick Meglio.

_______________________________________________
http://cool.haxx.se/mailman/listinfo/c-ares
Received on Tue Mar 8 18:57:05 2005