Windows: Fix local adapter ipv6 check

ip_lib.IPDevice.device_has_ip doesn't include ipv6 addresses when
checking if a local adapter is configured to use a certain address.

This change fixes this issue, which will also allow using ipv6
tunnel endpoints.

Co-authored-by: Alin Serdean <aserdean@cloudbasesolutions.com>
Change-Id: Iff3d25a5701b96df9da75cf398fd19d29e5cfeda
Closes-Bug: #1843889
This commit is contained in:
Lucian Petrut 2019-09-13 14:42:18 +03:00
parent 8887343782
commit 4844469842
1 changed files with 2 additions and 1 deletions

View File

@ -63,7 +63,8 @@ class IPDevice(object):
return False
addresses = [ip_addr['addr'] for ip_addr in
device_addresses.get(netifaces.AF_INET, [])]
device_addresses.get(netifaces.AF_INET, []) +
device_addresses.get(netifaces.AF_INET6, [])]
return ip in addresses