Only return valid ips from getInterfaceIps

This commit is contained in:
shortcutme 2019-01-30 14:51:45 +01:00
parent dd46a64e79
commit e18d3d0c93
No known key found for this signature in database
GPG key ID: 5B63BAE6CB9613AE

View file

@ -291,5 +291,5 @@ def getInterfaceIps(ip_type="ipv4"):
except:
pass
res = [re.sub("%.*", "", ip) for ip in res if getIpType(ip) == ip_type]
res = [re.sub("%.*", "", ip) for ip in res if getIpType(ip) == ip_type and isIp(ip)]
return list(set(res))