Browse code

- fix (backport): do not perform rev dns. when comparing an ip with a string or avp (in the script), if rev_dns is not set

Andrei Pelinescu-Onciul authored on 17/12/2007 17:51:35
Showing 2 changed files
... ...
@@ -154,7 +154,7 @@ extern int dns_try_ipv6;
154 154
 
155 155
 
156 156
 #define rev_resolvehost(ip)\
157
-					gethostbyaddr((char*)(ip)->u.addr, (ip)->len, (ip)->af);
157
+					gethostbyaddr((char*)(ip)->u.addr, (ip)->len, (ip)->af)
158 158
 
159 159
 
160 160
 
... ...
@@ -914,18 +914,16 @@ inline static int comp_ip(int op, struct ip_addr* ip, int rtype, union exp_op* r
914 914
 					/* 3: (slow) rev dns the address
915 915
 					* and compare with all the aliases
916 916
 					* !!??!! review: remove this? */
917
-					he=rev_resolvehost(ip);
918
-					if (he==0){
919
-						print_ip( "comp_ip: could not rev_resolve ip address:"
920
-									" ", ip, "\n");
921
-					ret=0;
922
-					}else{
917
+					if ((received_dns & DO_REV_DNS) && 
918
+							((he=rev_resolvehost(ip))!=0)){
923 919
 						/*  compare with primary host name */
924 920
 						ret=comp_string(op, he->h_name, rtype, r);
925 921
 						/* compare with all the aliases */
926 922
 						for(h=he->h_aliases; (ret!=1) && (*h); h++){
927 923
 							ret=comp_string(op, *h, rtype, r);
928 924
 						}
925
+					}else{
926
+						ret=0;
929 927
 					}
930 928
 					break;
931 929
 				case DIFF_OP: