[reSIProcate] Fix for DNS server logging
- From: ximalaya <ims3g@xxxxxxx>
- Date: Thu, 9 Feb 2012 20:51:07 +0800 (CST)
Hi,
The IP address logged is incorrect if a IPv6 DNS server is used. Following fix
can be applied,
rutil\dns\AresDns.cxx, line 346
InfoLog(<< "DNS initialization: found " << (*channel)->nservers << "
name servers");
for (int i = 0; i < (*channel)->nservers; ++i)
{
InfoLog(<< " name server: " <<
DnsUtil::inet_ntop((*channel)->servers[i].addr));
}
should change to,
InfoLog(<< "DNS initialization: found " << (*channel)->nservers << "
name servers");
for (int i = 0; i < (*channel)->nservers; ++i)
{
#ifdef USE_IPV6
if((*channel)->servers[i].family == AF_INET6) {
InfoLog(<< " name server: " <<
DnsUtil::inet_ntop((*channel)->servers[i].addr6));
} else
#endif
{
InfoLog(<< " name server: " <<
DnsUtil::inet_ntop((*channel)->servers[i].addr));
}
}
Thanks,
Xmly