[reSIProcate] Fix for DNS server logging

ximalaya ims3g at 126.com
Thu Feb 9 06:51:07 CST 2012


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



More information about the resiprocate-devel mailing list