mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
127.0.0.0/8 is all loopback
This commit is contained in:
parent
88b171f863
commit
ea43bb8101
1 changed files with 4 additions and 1 deletions
|
@ -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
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue