Skip to content

Commit

Permalink
Check IP versions before comparing (fixes #57)
Browse files Browse the repository at this point in the history
  • Loading branch information
milesmcc committed Jul 7, 2020
1 parent 80c66ce commit 3d27efb
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion shynet/analytics/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,10 @@ def ingress_request(
try:
remote_ip = ipaddress.ip_network(ip)
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
except ValueError as e:
log.exception(e)
Expand Down

0 comments on commit 3d27efb

Please sign in to comment.