summaryrefslogtreecommitdiff
path: root/python/vyos
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2020-01-25 10:36:02 +0100
committerChristian Poessinger <christian@poessinger.com>2020-01-25 10:36:02 +0100
commit6fe14cca59966ed3ecd482c0042b935bfb78c6cb (patch)
tree22dda7a3302a1f441dd0d1683fa344f780a5b887 /python/vyos
parentd933d5b3c03a67a11231017610ac7b795676a1c3 (diff)
downloadvyos-1x-6fe14cca59966ed3ecd482c0042b935bfb78c6cb.tar.gz
vyos-1x-6fe14cca59966ed3ecd482c0042b935bfb78c6cb.zip
vyos.validate: remove interface suffix when running is_ipv6_link_local()
Commit 17dd50751d ("bfd: T1949: fix verification logic for IPv6 BFD peers") added a mechanism to probe if an IPv6 address is link-local or not. Sometimes an interface suffix is appended by %interface to a link-local address, as we need to know an interface for which this address is (hence the name) link-local. Remove any interface identifier before checking if the address is local or not.
Diffstat (limited to 'python/vyos')
-rw-r--r--python/vyos/validate.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/python/vyos/validate.py b/python/vyos/validate.py
index 8ffef64fa..b6d8f23b8 100644
--- a/python/vyos/validate.py
+++ b/python/vyos/validate.py
@@ -58,6 +58,7 @@ def is_ipv6_link_local(addr):
"""
if is_ipv6(addr):
+ addr = addr.split('%')[0]
if ipaddress.IPv6Address(addr).is_link_local:
return True