diff 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
line wrap: on
line diff
--- a/src/dnsbl.cpp	Thu Mar 16 15:20:37 2006 -0800
+++ b/src/dnsbl.cpp	Sat Mar 25 09:47:08 2006 -0800
@@ -610,6 +610,9 @@
 	// make a dns question
 	const u_char *src = (const u_char *)&ip;
 	if (src[0] == 127) return false;	// don't do dns lookups on localhost
+	if (src[0] == 10)  return false;	// don't do dns lookups on rfc1918 space
+	if ((src[0] == 192) && (src[1] == 168)) return false;
+	if ((src[0] == 172) && (16 <= src[1]) && (src[1] <= 31)) return false;
 #ifdef NS_MAXDNAME
 	char question[NS_MAXDNAME];
 #else