Skip to content

Commit

Permalink
Fix IPv6 rule creation in chain traversal.
Browse files Browse the repository at this point in the history
  • Loading branch information
ldx committed Mar 5, 2013
1 parent 031fd22 commit 5130dfe
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 4 additions & 1 deletion iptc/ip4tc.py
Expand Up @@ -1206,7 +1206,7 @@ def _get_rules(self):
while entry:
entries.append(entry)
entry = self.table.next_rule(entry)
return [Rule(e, self) for e in entries]
return [self.table.create_rule(e, self) for e in entries]

rules = property(_get_rules)
"""This is the list of rules currently in the chain."""
Expand Down Expand Up @@ -1493,3 +1493,6 @@ def flush(self):
if not self.builtin_chain(chain):
chain.flush()
chain.delete()

def create_rule(self, entry=None, chain=None):
return Rule(entry, chain)
3 changes: 3 additions & 0 deletions iptc/ip6tc.py
Expand Up @@ -602,3 +602,6 @@ def __init__(self, name, autocommit=True):
self.name = name
self.autocommit = autocommit
self.refresh()

def create_rule(self, entry=None, chain=None):
return Rule6(entry, chain)

0 comments on commit 5130dfe

Please sign in to comment.