]> git.mxchange.org Git - quix0rs-apt-p2p.git/commitdiff
Fix the broken local IP regexes.
authorCameron Dale <camrdale@gmail.com>
Thu, 1 May 2008 20:04:46 +0000 (13:04 -0700)
committerCameron Dale <camrdale@gmail.com>
Thu, 1 May 2008 20:04:46 +0000 (13:04 -0700)
apt_p2p/util.py
apt_p2p_Khashmir/khashmir.py

index 51582f77ac2ef1d6554e7f60bcd178a251c6c487..345ab9afdc918b5945a759816bd28d09216103df 100644 (file)
@@ -12,7 +12,9 @@ from twisted.trial import unittest
 
 isLocal = re.compile('^(192\.168\.[0-9]{1,3}\.[0-9]{1,3})|'+
                      '(10\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3})|'+
-                     '(172\.0?([1][6-9])|([2][0-9])|([3][0-1])\.[0-9]{1,3}\.[0-9]{1,3})|'+
+                     '(172\.0?1[6-9]\.[0-9]{1,3}\.[0-9]{1,3})|'+
+                     '(172\.0?2[0-9]\.[0-9]{1,3}\.[0-9]{1,3})|'+
+                     '(172\.0?3[0-1]\.[0-9]{1,3}\.[0-9]{1,3})|'+
                      '(127\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3})$')
 
 def findMyIPAddr(addrs, intended_port, local_ok = False):
index 408a7e974b0f32a900a4c255d38fa59411ed6cc5..9509ce6bbff17e3a15fa4b4a3200ce9eb8bc7b7c 100644 (file)
@@ -29,7 +29,9 @@ import krpc
 
 isLocal = re.compile('^(192\.168\.[0-9]{1,3}\.[0-9]{1,3})|'+
                      '(10\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3})|'+
-                     '(172\.0?([1][6-9])|([2][0-9])|([3][0-1])\.[0-9]{1,3}\.[0-9]{1,3})|'+
+                     '(172\.0?1[6-9]\.[0-9]{1,3}\.[0-9]{1,3})|'+
+                     '(172\.0?2[0-9]\.[0-9]{1,3}\.[0-9]{1,3})|'+
+                     '(172\.0?3[0-1]\.[0-9]{1,3}\.[0-9]{1,3})|'+
                      '(127\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3})$')
 
 class KhashmirBase(protocol.Factory):