mirror of
https://codeberg.org/prof_x_pvt_ltd/captive.whump.shanti-portal
synced 2024-08-14 22:46:42 +00:00
fixed bug in IPv4Interface handling
This commit is contained in:
parent
2ce96c51bb
commit
6214f65c0b
1 changed files with 6 additions and 1 deletions
|
@ -84,9 +84,14 @@ class Client(object):
|
||||||
|
|
||||||
|
|
||||||
def find_rule(self, ip_address, protocol):
|
def find_rule(self, ip_address, protocol):
|
||||||
|
"""
|
||||||
|
Takes an ipaddress.IPv4Interface object as ip_address argument.
|
||||||
|
"""
|
||||||
|
|
||||||
for rule in self.chain.rules:
|
for rule in self.chain.rules:
|
||||||
src_ip = rule.src
|
src_ip = rule.src
|
||||||
if src_ip.startswith(ip_address) and rule.protocol == protocol:
|
_ip = str(ip_address.ip)
|
||||||
|
if src_ip.startswith(str(ip_address.ip)) and rule.protocol == protocol:
|
||||||
return rule
|
return rule
|
||||||
else:
|
else:
|
||||||
return None
|
return None
|
||||||
|
|
Loading…
Reference in a new issue