mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-11 07:46:07 -07:00
Check for local IPv6 addresses
This commit is contained in:
parent
f2a664953c
commit
2145f1e272
1 changed files with 5 additions and 1 deletions
|
@ -705,7 +705,11 @@ def sanitize(obj):
|
|||
|
||||
def is_public_ip(host):
|
||||
ip = is_valid_ip(get_ip(host))
|
||||
if ip and (ip.iptype() == 'PUBLIC' or ip.version() == 6):
|
||||
ip_version = ip.version()
|
||||
ip_type = ip.iptype()
|
||||
if ip and ip_type != 'LOOPBACK' and (
|
||||
ip_version == 4 and ip_type == 'PUBLIC' or
|
||||
ip_version == 6 and 'LOCAL' not in ip_type):
|
||||
return True
|
||||
return False
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue