Permalink
Browse files

get_DNS_AdaptersAddresses: fix IPv6 parsing

Use of the wrong define made the function not parse IPv6 addresses
properly.

Bug: http://c-ares.haxx.se/mail/c-ares-archive-2012-06/0028.shtml
Reported by: Saúl Ibarra Corretgé
  • Loading branch information...
1 parent 2b89707 commit 65ac7e706d852c0b57bfdb7822c0a203cf5de995 @bagder bagder committed Aug 22, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 ares_init.c
View
2 ares_init.c
@@ -1019,7 +1019,7 @@ static int get_DNS_AdaptersAddresses(char **outptr)
if (memcmp(&namesrvr.sa6->sin6_addr, &ares_in6addr_any,
sizeof(namesrvr.sa6->sin6_addr)) == 0)
continue;
- if (! ares_inet_ntop(AF_INET, &namesrvr.sa6->sin6_addr,
+ if (! ares_inet_ntop(AF_INET6, &namesrvr.sa6->sin6_addr,
txtaddr, sizeof(txtaddr)))
continue;
}

0 comments on commit 65ac7e7

Please sign in to comment.