summaryrefslogtreecommitdiff
path: root/python/vyos
diff options
context:
space:
mode:
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.