diff options
author | Christian Poessinger <christian@poessinger.com> | 2020-01-25 10:36:02 +0100 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2020-01-25 10:36:02 +0100 |
commit | 6fe14cca59966ed3ecd482c0042b935bfb78c6cb (patch) | |
tree | 22dda7a3302a1f441dd0d1683fa344f780a5b887 /python/vyos/validate.py | |
parent | d933d5b3c03a67a11231017610ac7b795676a1c3 (diff) | |
download | vyos-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/validate.py')
-rw-r--r-- | python/vyos/validate.py | 1 |
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 |