Skip to content
Snippets Groups Projects
Commit 46545cab authored by Stuart Gathman's avatar Stuart Gathman
Browse files

Fix missed comcast dynip.

parent 9a8fdcb1
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
......@@ -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__':
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment