summaryrefslogtreecommitdiff
path: root/python/vyos
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2020-12-06 21:53:40 +0100
committerGitHub <noreply@github.com>2020-12-06 21:53:40 +0100
commit6b7aa5ae54b52875b82a42b41ffea939d2eba180 (patch)
treeeb681f7d1ad59e401d8cdd53641605669f4f7ddb /python/vyos
parentb2ee69bbfb73f0195e8e29b12aca0cb18dc91c98 (diff)
downloadvyos-1x-6b7aa5ae54b52875b82a42b41ffea939d2eba180.tar.gz
vyos-1x-6b7aa5ae54b52875b82a42b41ffea939d2eba180.zip
vyos.validate: T1579: support prefix length in is_ipv6_link_local()
Function can now be called with a prefix length like 2001:db8::1/64
Diffstat (limited to 'python/vyos')
-rw-r--r--python/vyos/validate.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/python/vyos/validate.py b/python/vyos/validate.py
index 84a7bc2de..98bd40f74 100644
--- a/python/vyos/validate.py
+++ b/python/vyos/validate.py
@@ -27,11 +27,11 @@ from vyos.util import cmd
def is_ipv6_link_local(addr):
""" Check if addrsss is an IPv6 link-local address. Returns True/False """
- from ipaddress import IPv6Address
+ from ipaddress import ip_interface
from vyos.template import is_ipv6
addr = addr.split('%')[0]
if is_ipv6(addr):
- if IPv6Address(addr).is_link_local:
+ if ip_interface(addr).is_link_local:
return True
return False