From ceda22ec9474811d89d0082564ef19e77653937c Mon Sep 17 00:00:00 2001 From: mailchuck Date: Thu, 12 Nov 2015 17:36:12 +0100 Subject: [PATCH] Private IP range update Addresses Bitmessage#768 --- src/class_receiveDataThread.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/class_receiveDataThread.py b/src/class_receiveDataThread.py index 07569b7b..19135c1f 100644 --- a/src/class_receiveDataThread.py +++ b/src/class_receiveDataThread.py @@ -485,13 +485,16 @@ class receiveDataThread(threading.Thread): def _checkIPv4Address(self, host, hostStandardFormat): # print 'hostStandardFormat', hostStandardFormat - if host[0] == '\x7F': + if host[0] == '\x7F': # 127/8 print 'Ignoring IP address in loopback range:', hostStandardFormat return False - if host[0] == '\x0A': + if host[0] == '\x0A': # 10/8 print 'Ignoring IP address in private range:', hostStandardFormat return False - if host[0:2] == '\xC0\xA8': + if host[0:2] == '\xC0\xA8': # 192.168/16 + print 'Ignoring IP address in private range:', hostStandardFormat + return False + if host[0:2] >= '\xAC\x10' and host[0:2] < '\xAC\x20': # 172.16/12 print 'Ignoring IP address in private range:', hostStandardFormat return False return True