Merge pull request #39066 from techhat/issue39051

127.0.0.0/8 is all loopback
This commit is contained in:
Mike Place 2017-01-31 11:43:21 -07:00 committed by GitHub
commit 721b245f90

View file

@ -2271,7 +2271,7 @@ def is_public_ip(ip):
return True
addr = ip_to_int(ip)
if addr > 167772160 and addr < 184549375:
# 10.0.0.0/24
# 10.0.0.0/8
return False
elif addr > 3232235520 and addr < 3232301055:
# 192.168.0.0/16
@ -2279,6 +2279,9 @@ def is_public_ip(ip):
elif addr > 2886729728 and addr < 2887778303:
# 172.16.0.0/12
return False
elif addr > 2130706432 and addr < 2147483647:
# 127.0.0.0/8
return False
return True