Check IP versions before comparing (fixes #57)
This commit is contained in:
parent
80c66ceb8e
commit
3d27efba8b
@ -64,7 +64,10 @@ def ingress_request(
|
|||||||
try:
|
try:
|
||||||
remote_ip = ipaddress.ip_network(ip)
|
remote_ip = ipaddress.ip_network(ip)
|
||||||
for ignored_network in service.get_ignored_networks():
|
for ignored_network in service.get_ignored_networks():
|
||||||
if ignored_network.supernet_of(remote_ip):
|
if (
|
||||||
|
ignored_network.version == remote_ip.version
|
||||||
|
and ignored_network.supernet_of(remote_ip)
|
||||||
|
):
|
||||||
return
|
return
|
||||||
except ValueError as e:
|
except ValueError as e:
|
||||||
log.exception(e)
|
log.exception(e)
|
||||||
|
Loading…
Reference in New Issue
Block a user