Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
pymilter
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
misc
pymilter
Commits
46545cab
Commit
46545cab
authored
17 years ago
by
Stuart Gathman
Browse files
Options
Downloads
Patches
Plain Diff
Fix missed comcast dynip.
parent
9a8fdcb1
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
Milter/dynip.py
+3
-1
3 additions, 1 deletion
Milter/dynip.py
testutils.py
+2
-0
2 additions, 0 deletions
testutils.py
with
5 additions
and
1 deletion
Milter/dynip.py
+
3
−
1
View file @
46545cab
...
@@ -44,6 +44,8 @@ def is_dynip(host,addr):
...
@@ -44,6 +44,8 @@ def is_dynip(host,addr):
True
True
>>>
is_dynip
(
'
[1.2.3.4]
'
,
'
1.2.3.4
'
)
>>>
is_dynip
(
'
[1.2.3.4]
'
,
'
1.2.3.4
'
)
True
True
>>>
is_dynip
(
'
c-71-63-151-151.hsd1.mn.comcast.net
'
,
'
71.63.151.151
'
)
True
"""
"""
if
host
.
startswith
(
'
[
'
)
and
host
.
endswith
(
'
]
'
):
if
host
.
startswith
(
'
[
'
)
and
host
.
endswith
(
'
]
'
):
return
True
return
True
...
@@ -54,7 +56,7 @@ def is_dynip(host,addr):
...
@@ -54,7 +56,7 @@ def is_dynip(host,addr):
h
=
host
h
=
host
m
=
ip3
.
findall
(
host
)
m
=
ip3
.
findall
(
host
)
if
m
:
if
m
:
g
=
map
(
int
,
m
)
g
=
map
(
int
,
m
)
[:
4
]
ia3
=
(
ia
[
1
:],
ia
[:
3
])
ia3
=
(
ia
[
1
:],
ia
[:
3
])
if
g
[
-
3
:]
in
ia3
:
return
True
if
g
[
-
3
:]
in
ia3
:
return
True
if
g
[
0
]
==
ia
[
3
]
and
g
[
1
:
3
]
==
ia
[:
2
]:
return
True
if
g
[
0
]
==
ia
[
3
]
and
g
[
1
:
3
]
==
ia
[:
2
]:
return
True
...
...
This diff is collapsed.
Click to expand it.
testutils.py
+
2
−
0
View file @
46545cab
...
@@ -3,6 +3,7 @@ import doctest
...
@@ -3,6 +3,7 @@ import doctest
import
os
import
os
import
Milter.utils
import
Milter.utils
from
Milter.cache
import
AddrCache
from
Milter.cache
import
AddrCache
from
Milter.dynip
import
is_dynip
class
AddrCacheTestCase
(
unittest
.
TestCase
):
class
AddrCacheTestCase
(
unittest
.
TestCase
):
...
@@ -40,6 +41,7 @@ class AddrCacheTestCase(unittest.TestCase):
...
@@ -40,6 +41,7 @@ class AddrCacheTestCase(unittest.TestCase):
def
suite
():
def
suite
():
s
=
unittest
.
makeSuite
(
AddrCacheTestCase
,
'
test
'
)
s
=
unittest
.
makeSuite
(
AddrCacheTestCase
,
'
test
'
)
s
.
addTest
(
doctest
.
DocTestSuite
(
Milter
.
utils
))
s
.
addTest
(
doctest
.
DocTestSuite
(
Milter
.
utils
))
s
.
addTest
(
doctest
.
DocTestSuite
(
Milter
.
dynip
))
return
s
return
s
if
__name__
==
'
__main__
'
:
if
__name__
==
'
__main__
'
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment