summaryrefslogtreecommitdiff
path: root/python/vyos/validate.py
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2023-05-29 09:55:39 +0200
committerChristian Breunig <christian@breunig.cc>2023-05-29 09:56:19 +0200
commitea01c2df78ddb9a6dcaf65c3d9bb2a267c8df883 (patch)
treeb46e5954d8501983270f165cd32aad8c6782e4b5 /python/vyos/validate.py
parentfdd5b644ec566b75e58a45478c94364858ac053e (diff)
downloadvyos-1x-ea01c2df78ddb9a6dcaf65c3d9bb2a267c8df883.tar.gz
vyos-1x-ea01c2df78ddb9a6dcaf65c3d9bb2a267c8df883.zip
ifconfig: T2104: use link_local_prefix literal for fe80::/64
Diffstat (limited to 'python/vyos/validate.py')
-rw-r--r--python/vyos/validate.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/python/vyos/validate.py b/python/vyos/validate.py
index a83193363..d18785aaf 100644
--- a/python/vyos/validate.py
+++ b/python/vyos/validate.py
@@ -62,7 +62,7 @@ def is_intf_addr_assigned(intf, address) -> bool:
# 10: [{'addr': 'fe80::a00:27ff:fed9:5b04%eth0', 'netmask': 'ffff:ffff:ffff:ffff::'}]
# }
try:
- ifaces = ifaddresses(intf)
+ addresses = ifaddresses(intf)
except ValueError as e:
print(e)
return False
@@ -74,7 +74,7 @@ def is_intf_addr_assigned(intf, address) -> bool:
netmask = None
if '/' in address:
address, netmask = address.split('/')
- for ip in ifaces.get(addr_type,[]):
+ for ip in addresses.get(addr_type, []):
# ip can have the interface name in the 'addr' field, we need to remove it
# {'addr': 'fe80::a00:27ff:fec5:f821%eth2', 'netmask': 'ffff:ffff:ffff:ffff::'}
ip_addr = ip['addr'].split('%')[0]