Subject: [RFC] Support querying IPv6 servers

[RFC] Support querying IPv6 servers

From: Gregor Jasny <jasny_at_vidsoft.de>
Date: Mon, 24 Nov 2008 10:56:18 +0100

Hello,

Here comes another feature patch for the reSIProcate transition from
ares to c-ares. The embedded copy supports querying IPv6 nameservers and
setting these up via the options structure.

The reSIProcate developers substituted the in_addr field by an union
contruct to hold the in6_addr. As this would break API compatibility, I
have added a second nservers and servers field and suffixed it with a '6'.

For the internal part I've declared the mf_address structure:
   struct mf_address {
     sa_family_t family;
     union
     {
       struct in_addr in4;
       struct in6_addr in6;
     } mf_addr;
   };

Another approach would be the usage of sockaddr_storage. But all the
casting to sockaddr_in and sockaddr_in6 made the code very ugly and hard
to read. Maybe some macros would help here. The other drawback of
sockaddr_storage is it's relativly young age, so that it's (probably)
not available on all target platforms.

Things that needs to be done:
* Guard the AF_INET6 specific part by the preprocessor. What
(config-)defines would be optimal for this task? A combination of
HAVE_AF_INET6, HAVE_STRUCT_SOCKADDR_STORAGE, HAVE_STRUCT_SOCKADDR_IN6?

* Test on all supported target platforms

* Documentation

But before I continue I'd like to get some feedback on this issue.

Thanks,
Gregor

Received on 2008-11-24