Module: sip-router
Branch: master
Commit: e1b3961b16b76b02ae7ad5f52b2e9db126f81ff9
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=e1b3961…
Author: Carsten Bock <carsten(a)ng-voice.com>
Committer: Carsten Bock <carsten(a)ng-voice.com>
Date: Tue Sep 11 19:39:32 2012 +0200
Do not perform a lookup for IPv4 addresses, if only listening on IPv6 sockets.
---
resolve.h | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/resolve.h b/resolve.h
index 8ce68e6..eeae6c2 100644
--- a/resolve.h
+++ b/resolve.h
@@ -429,8 +429,10 @@ static inline struct hostent* _resolvehost(char* name)
}
#endif
#endif
- /* ipv4 */
- he=gethostbyname(name);
+ if (socket_types & SOCKET_T_IPV4) {
+ /* ipv4 */
+ he=gethostbyname(name);
+ }
#ifdef USE_IPV6
if(he==0 && cfg_get(core, core_cfg, dns_try_ipv6)){
#ifndef DNS_IP_HACK