diff options
author | Andrew Tridgell <tridge@samba.org> | 2011-06-07 12:35:10 +1000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2011-06-07 12:55:37 +1000 |
commit | 64380ff050c77b2b67c0fac4ada8650e834c4b4a (patch) | |
tree | e79f4f8f4e8d75da638e7793fce0cd66c24adf65 | |
parent | 5d7ba305490b5047b4d404353e95c217c8ef7d10 (diff) | |
download | samba-64380ff050c77b2b67c0fac4ada8650e834c4b4a.tar.gz samba-64380ff050c77b2b67c0fac4ada8650e834c4b4a.tar.bz2 samba-64380ff050c77b2b67c0fac4ada8650e834c4b4a.zip |
s4-ipv6: fixed DNS handling with new IPv6 code
-rw-r--r-- | source4/libcli/resolve/dns_ex.c | 17 |
1 files changed, 16 insertions, 1 deletions
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; } |