[sr-dev] git:3.3: core: try to detect ipv6 addresses only when USE_IPV6 is used
Juha Heinanen
jh at tutpro.com
Tue Mar 26 09:47:25 CET 2013
Module: sip-router
Branch: 3.3
Commit: a3a61d084fa03206cf447f6bd9ae9c8c3d81c8c6
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=a3a61d084fa03206cf447f6bd9ae9c8c3d81c8c6
Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Juha Heinanen <jh at tutpro.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
(cherry picked from commit b035aa9f2cc19d387b1b8f33a7888ffee27a4138)
---
dns_cache.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/dns_cache.c b/dns_cache.c
index ea9ff34..cf7c4f8 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