summaryrefslogtreecommitdiff
path: root/python/vyos
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2020-01-20 11:22:54 +0800
committerGitHub <noreply@github.com>2020-01-20 11:22:54 +0800
commit09c2b6f9e2c0abd10ef76947c71874128c27af50 (patch)
treefaae62eedae048456ab9ab721ec55272aefb2ba1 /python/vyos
parent742da889afa4375d5b6cb98dada7f2d3ec2f0326 (diff)
parent17dd50751d72079ff67c67b3b4143ec234793955 (diff)
downloadvyos-1x-09c2b6f9e2c0abd10ef76947c71874128c27af50.tar.gz
vyos-1x-09c2b6f9e2c0abd10ef76947c71874128c27af50.zip
Merge pull request #199 from bmhughes/fix-ipv6-bfd-verification
bfd: T1949: fix verification logic for IPv6 BFD peers
Diffstat (limited to 'python/vyos')
-rw-r--r--python/vyos/validate.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/python/vyos/validate.py b/python/vyos/validate.py
index 1ce5a8467..8ffef64fa 100644
--- a/python/vyos/validate.py
+++ b/python/vyos/validate.py
@@ -52,6 +52,17 @@ def is_ipv6(addr):
return False
+def is_ipv6_link_local(addr):
+ """
+ Check addr if it is an IPv6 link-local address/network. Returns True/False
+ """
+
+ if is_ipv6(addr):
+ if ipaddress.IPv6Address(addr).is_link_local:
+ return True
+
+ return False
+
def is_intf_addr_assigned(intf, addr):
"""
Verify if the given IPv4/IPv6 address is assigned to specific interface.