Fix missed comcast dynip.

This commit is contained in:
Stuart Gathman
2007-06-28 20:33:25 +00:00
parent 9a8fdcb120
commit 46545cab94
2 changed files with 5 additions and 1 deletions
+3 -1
View File
@@ -44,6 +44,8 @@ def is_dynip(host,addr):
True
>>> is_dynip('[1.2.3.4]','1.2.3.4')
True
>>> is_dynip('c-71-63-151-151.hsd1.mn.comcast.net','71.63.151.151')
True
"""
if host.startswith('[') and host.endswith(']'):
return True
@@ -54,7 +56,7 @@ def is_dynip(host,addr):
h = host
m = ip3.findall(host)
if m:
g = map(int,m)
g = map(int,m)[:4]
ia3 = (ia[1:],ia[:3])
if g[-3:] in ia3: return True
if g[0] == ia[3] and g[1:3] == ia[:2]: return True
+2
View File
@@ -3,6 +3,7 @@ import doctest
import os
import Milter.utils
from Milter.cache import AddrCache
from Milter.dynip import is_dynip
class AddrCacheTestCase(unittest.TestCase):
@@ -40,6 +41,7 @@ class AddrCacheTestCase(unittest.TestCase):
def suite():
s = unittest.makeSuite(AddrCacheTestCase,'test')
s.addTest(doctest.DocTestSuite(Milter.utils))
s.addTest(doctest.DocTestSuite(Milter.dynip))
return s
if __name__ == '__main__':