summaryrefslogtreecommitdiff
path: root/pjlib-util/src/pjlib-util/dns_dump.c
diff options
context:
space:
mode:
authorLiong Sauw Ming <ming@teluu.com>2016-05-20 04:17:00 +0000
committerLiong Sauw Ming <ming@teluu.com>2016-05-20 04:17:00 +0000
commit58d6c60c881d265cee8c5ca5dbaad545ff44e995 (patch)
treeb2bb5a9c72e01491d8dd6bce70d3a4c6c1ab4750 /pjlib-util/src/pjlib-util/dns_dump.c
parent2e1173b56db0083559b4bc09e00d27d03dbad8bc (diff)
Re #1922: Replace IPv4 specific APIs as per Apple's recommendations
https://developer.apple.com/library/ios/documentation/NetworkingInternetWeb/Conceptual/NetworkingOverview/UnderstandingandPreparingfortheIPv6Transition/UnderstandingandPreparingfortheIPv6Transition.html#//apple_ref/doc/uid/TP40010220-CH213-SW27 git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@5311 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjlib-util/src/pjlib-util/dns_dump.c')
-rw-r--r--pjlib-util/src/pjlib-util/dns_dump.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/pjlib-util/src/pjlib-util/dns_dump.c b/pjlib-util/src/pjlib-util/dns_dump.c
index fdf29318..ab9ca684 100644
--- a/pjlib-util/src/pjlib-util/dns_dump.c
+++ b/pjlib-util/src/pjlib-util/dns_dump.c
@@ -90,6 +90,7 @@ static void dump_answer(unsigned index, const pj_dns_parsed_rr *rr)
const pj_str_t root_name = { "<Root>", 6 };
const pj_str_t *name = &rr->name;
char ttl_words[32];
+ char addr[PJ_INET6_ADDRSTRLEN];
if (name->slen == 0)
name = &root_name;
@@ -117,9 +118,9 @@ static void dump_answer(unsigned index, const pj_dns_parsed_rr *rr)
rr->rdata.cname.name.ptr));
} else if (rr->type == PJ_DNS_TYPE_A) {
PJ_LOG(3,(THIS_FILE, " IP address: %s",
- pj_inet_ntoa(rr->rdata.a.ip_addr)));
+ pj_inet_ntop2(pj_AF_INET(), &rr->rdata.a.ip_addr,
+ addr, sizeof(addr))));
} else if (rr->type == PJ_DNS_TYPE_AAAA) {
- char addr[PJ_INET6_ADDRSTRLEN];
PJ_LOG(3,(THIS_FILE, " IPv6 address: %s",
pj_inet_ntop2(pj_AF_INET6(), &rr->rdata.aaaa.ip_addr,
addr, sizeof(addr))));