From: Cameron Dale Date: Thu, 1 May 2008 20:04:46 +0000 (-0700) Subject: Fix the broken local IP regexes. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=aefd29ced51580f57e487d48e71d7ce8f17bf081;p=quix0rs-apt-p2p.git Fix the broken local IP regexes. --- diff --git a/apt_p2p/util.py b/apt_p2p/util.py index 51582f7..345ab9a 100644 --- a/apt_p2p/util.py +++ b/apt_p2p/util.py @@ -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): diff --git a/apt_p2p_Khashmir/khashmir.py b/apt_p2p_Khashmir/khashmir.py index 408a7e9..9509ce6 100644 --- a/apt_p2p_Khashmir/khashmir.py +++ b/apt_p2p_Khashmir/khashmir.py @@ -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):