if it is ipv6 ip_to_int will fail

fixes bug introduced in #23573
This commit is contained in:
Daniel Wallace 2015-05-15 19:51:37 -05:00
parent 5263db9dd5
commit 2da98b58c8

View File

@ -1728,6 +1728,9 @@ def is_public_ip(ip):
'''
Determines whether an IP address falls within one of the private IP ranges
'''
if ':' in ip:
# ipv6
return True
addr = ip_to_int(ip)
if addr > 167772160 and addr < 184549375:
# 10.0.0.0/24