From 6fe14cca59966ed3ecd482c0042b935bfb78c6cb Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Sat, 25 Jan 2020 10:36:02 +0100 Subject: 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. --- python/vyos/validate.py | 1 + 1 file changed, 1 insertion(+) 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 -- cgit v1.2.3