[sr-dev] git:master: core: try to detect ipv6 addresses only when USE_IPV6 is used

Daniel-Constantin Mierla miconda at gmail.com
Sun Mar 10 23:54:31 CET 2013


Module: sip-router
Branch: master
Commit: b035aa9f2cc19d387b1b8f33a7888ffee27a4138
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=b035aa9f2cc19d387b1b8f33a7888ffee27a4138

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date:   Sun Mar 10 23:53:26 2013 +0100

core: try to detect ipv6 addresses only when USE_IPV6 is used

- reported by Juha Heinanen

---

 dns_cache.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/dns_cache.c b/dns_cache.c
index b56e94d..b351490 100644
--- a/dns_cache.c
+++ b/dns_cache.c
@@ -1891,8 +1891,10 @@ inline static struct dns_hash_entry* dns_cache_do_request(str* name, int type)
 #endif /* USE_DNS_CACHE_STATS */
 
 	if (type==T_A){
+#ifdef USE_IPV6
 		if (str2ip6(name)!=0)
 			goto end;
+#endif /* USE_IPV6 */
 		if ((ip=str2ip(name))!=0){
 				e=dns_cache_mk_ip_entry(name, ip);
 				if (likely(e))
@@ -2469,8 +2471,10 @@ inline static struct hostent* dns_a_get_he(str* name)
 	struct hostent* he;
 
 	e=0;
+#ifdef	USE_IPV6
 	if (str2ip6(name)!=0)
 		return 0;
+#endif
 	if ((ip=str2ip(name))!=0){
 		return ip_addr2he(name, ip);
 	}
@@ -2971,8 +2975,10 @@ inline static int dns_a_resolve( struct dns_hash_entry** e,
 	ret=-E_DNS_NO_IP;
 	if (*e==0){ /* do lookup */
 		/* if ip don't set *e */
+#ifdef	USE_IPV6
 		if (str2ip6(name)!=0)
 			goto error;
+#endif
 		if ((tmp=str2ip(name))!=0){
 			*ip=*tmp;
 			*rr_no=0;




More information about the sr-dev mailing list