...
|
...
|
@@ -36,6 +36,8 @@
|
36
|
36
|
* 2003-04-01 added dst_port, proto, af; renamed comp_port to comp_no,
|
37
|
37
|
* inlined all the comp_* functions (andrei)
|
38
|
38
|
* 2003-04-05 s/reply_route/failure_route, onreply_route introduced (jiri)
|
|
39
|
+ * 2003-05-23 comp_ip fixed, now it will resolve its operand and compare
|
|
40
|
+ * the ip with all the addresses (andrei)
|
39
|
41
|
*/
|
40
|
42
|
|
41
|
43
|
|
...
|
...
|
@@ -350,14 +352,21 @@ inline static int comp_ip(struct ip_addr* ip, void* param, int op, int subtype)
|
350
|
352
|
case STRING_ST:
|
351
|
353
|
case RE_ST:
|
352
|
354
|
/* 1: compare with ip2str*/
|
353
|
|
- /* !!!??? review reminder ( resolve(name) & compare w/ all ips? */
|
354
|
|
-#if 0
|
355
|
|
- ret=comp_str(inet_ntoa(*(struct in_addr*)&a), param, op,
|
356
|
|
- subtype);
|
|
355
|
+ ret=comp_str(ip_addr2a(ip), param, op, subtype);
|
357
|
356
|
if (ret==1) break;
|
358
|
|
-#endif
|
359
|
|
- /* 2: (slow) rev dns the address
|
360
|
|
- * and compare with all the aliases */
|
|
357
|
+ /* 2: resolve (name) & compare w/ all the ips */
|
|
358
|
+ he=resolvehost((char*)param);
|
|
359
|
+ if (he==0){
|
|
360
|
+ DBG("comp_ip: could not resolve %s\n", (char*)param);
|
|
361
|
+ }else if (he->h_addrtype==ip->af){
|
|
362
|
+ for(h=he->h_addr_list;(ret!=1)&& (*h); h++){
|
|
363
|
+ ret=(memcmp(ip->u.addr, *h, ip->len)==0);
|
|
364
|
+ }
|
|
365
|
+ if (ret==1) break;
|
|
366
|
+ }
|
|
367
|
+ /* 3: (slow) rev dns the address
|
|
368
|
+ * and compare with all the aliases
|
|
369
|
+ * !!??!! review: remove this? */
|
361
|
370
|
he=rev_resolvehost(ip);
|
362
|
371
|
if (he==0){
|
363
|
372
|
DBG( "comp_ip: could not rev_resolve ip address: ");
|