Subject: zone index ignored

zone index ignored

From: Gisle Vanem <>
Date: Tue, 11 Oct 2011 20:32:05 +0200

The code in ares_nit.c and get_iphlpapi_dns_info()
seems to ignore the 'zone index' for IPv6 DNS-addresesses.

Here is what GetAdaptersAddresses() returns for one of
my adapters (I have IPv6 installed):
     Adapter name: {48FCE3FC-EC30-E50E-F1A7-71172AEEE3AE}
             Unicast Addresses: fe80::5efe:
             Anycast Addresses: <none>
             Multicast Addresses: <none>
             DNS Servers: fec0:0:0:ffff::1%2

In get_iphlpapi_dns_info(), the output of GetAdaptersAddresses() is parsed:

        else if( pGenericAddr->sa_family == AF_INET6 && left > ipv6_size )
          /* Handle the v6 case */
          struct sockaddr_in6 *pIPv6Addr = ( struct sockaddr_in6 * ) pGenericAddr;
          ares_inet_ntop( AF_INET6, &pIPv6Addr->sin6_addr, ret, ipv6_size - 1 ); /* -1 for comma */

ares_inet_ntop() doesn't AFAICS grok the "%zone-index" syntax. Ref.

The end result will be that C-ares hangs "forever" trying to contact the DNS-servers
on such zoneless IPv6 non-global addresses.

I think the fix would be to use WSAAddressToString() instead of

Received on 2011-10-11