comparison src/dnsbl.cpp @ 126:05ae49d37896 stable-5-17

don't do dnsbl lookups on rfc1918 address space
author carl
date Sat, 25 Mar 2006 09:47:08 -0800
parents ea6f9c812faa
children 2b1a4701e856
comparison
equal deleted inserted replaced
125:8b1562482b29 126:05ae49d37896
608 bool check_single(mlfiPriv &priv, int ip, char *suffix); 608 bool check_single(mlfiPriv &priv, int ip, char *suffix);
609 bool check_single(mlfiPriv &priv, int ip, char *suffix) { 609 bool check_single(mlfiPriv &priv, int ip, char *suffix) {
610 // make a dns question 610 // make a dns question
611 const u_char *src = (const u_char *)&ip; 611 const u_char *src = (const u_char *)&ip;
612 if (src[0] == 127) return false; // don't do dns lookups on localhost 612 if (src[0] == 127) return false; // don't do dns lookups on localhost
613 if (src[0] == 10) return false; // don't do dns lookups on rfc1918 space
614 if ((src[0] == 192) && (src[1] == 168)) return false;
615 if ((src[0] == 172) && (16 <= src[1]) && (src[1] <= 31)) return false;
613 #ifdef NS_MAXDNAME 616 #ifdef NS_MAXDNAME
614 char question[NS_MAXDNAME]; 617 char question[NS_MAXDNAME];
615 #else 618 #else
616 char question[1000]; 619 char question[1000];
617 #endif 620 #endif