From 64380ff050c77b2b67c0fac4ada8650e834c4b4a Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 7 Jun 2011 12:35:10 +1000 Subject: s4-ipv6: fixed DNS handling with new IPv6 code --- source4/libcli/resolve/dns_ex.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'source4/libcli') diff --git a/source4/libcli/resolve/dns_ex.c b/source4/libcli/resolve/dns_ex.c index 069ba823c2..cb2d2c3d2c 100644 --- a/source4/libcli/resolve/dns_ex.c +++ b/source4/libcli/resolve/dns_ex.c @@ -267,7 +267,22 @@ static void run_child_dns_lookup(struct dns_ex_state *state, int fd) port = state->port; } - if (!print_sockaddr_len(addrstr, sizeof(addrstr), (struct sockaddr *)addrs_rr[i]->u.data, addrs_rr[i]->size)) { + switch (rr->type) { + case rk_ns_t_a: + if (inet_ntop(AF_INET, addrs_rr[i]->u.a, + addrstr, sizeof(addrstr)) == NULL) { + continue; + } + break; +#ifdef HAVE_IPV6 + case rk_ns_t_aaaa: + if (inet_ntop(AF_INET6, (struct in6_addr *)addrs_rr[i]->u.data, + addrstr, sizeof(addrstr)) == NULL) { + continue; + } + break; +#endif + default: continue; } -- cgit