Browse code

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

- reported by Juha Heinanen

Daniel-Constantin Mierla authored on 10/03/2013 22:53:26
Showing 1 changed files
... ...
@@ -1891,8 +1891,10 @@ inline static struct dns_hash_entry* dns_cache_do_request(str* name, int type)
1891 1891
 #endif /* USE_DNS_CACHE_STATS */
1892 1892
 
1893 1893
 	if (type==T_A){
1894
+#ifdef USE_IPV6
1894 1895
 		if (str2ip6(name)!=0)
1895 1896
 			goto end;
1897
+#endif /* USE_IPV6 */
1896 1898
 		if ((ip=str2ip(name))!=0){
1897 1899
 				e=dns_cache_mk_ip_entry(name, ip);
1898 1900
 				if (likely(e))
... ...
@@ -2469,8 +2471,10 @@ inline static struct hostent* dns_a_get_he(str* name)
2469 2469
 	struct hostent* he;
2470 2470
 
2471 2471
 	e=0;
2472
+#ifdef	USE_IPV6
2472 2473
 	if (str2ip6(name)!=0)
2473 2474
 		return 0;
2475
+#endif
2474 2476
 	if ((ip=str2ip(name))!=0){
2475 2477
 		return ip_addr2he(name, ip);
2476 2478
 	}
... ...
@@ -2971,8 +2975,10 @@ inline static int dns_a_resolve( struct dns_hash_entry** e,
2971 2971
 	ret=-E_DNS_NO_IP;
2972 2972
 	if (*e==0){ /* do lookup */
2973 2973
 		/* if ip don't set *e */
2974
+#ifdef	USE_IPV6
2974 2975
 		if (str2ip6(name)!=0)
2975 2976
 			goto error;
2977
+#endif
2976 2978
 		if ((tmp=str2ip(name))!=0){
2977 2979
 			*ip=*tmp;
2978 2980
 			*rr_no=0;