summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2022-01-15 16:50:39 +0100
committerGitHub <noreply@github.com>2022-01-15 16:50:39 +0100
commit31a27136a499625f11b21eb611b437fcb2253edb (patch)
tree8dce7b413f54a0d0104271e121638a3401289b76
parentb5b9685c37aa48a88bdd697e4c46e94d274a5d95 (diff)
parentc39d6dd7f6a837a54b92e0030120587746a85968 (diff)
downloadvyos-1x-31a27136a499625f11b21eb611b437fcb2253edb.tar.gz
vyos-1x-31a27136a499625f11b21eb611b437fcb2253edb.zip
Merge pull request #1170 from sever-sever/T4183-equ
T4183: T4110: Ability to set IPv6-link-local addresses for services and wg
-rw-r--r--interface-definitions/include/listen-address.xml.i1
-rw-r--r--interface-definitions/interfaces-wireguard.xml.in1
-rwxr-xr-xsrc/validators/ipv6-link-local12
3 files changed, 14 insertions, 0 deletions
diff --git a/interface-definitions/include/listen-address.xml.i b/interface-definitions/include/listen-address.xml.i
index 9b86851c7..f6ee676f4 100644
--- a/interface-definitions/include/listen-address.xml.i
+++ b/interface-definitions/include/listen-address.xml.i
@@ -17,6 +17,7 @@
<constraint>
<validator name="ipv4-address"/>
<validator name="ipv6-address"/>
+ <validator name="ipv6-link-local"/>
</constraint>
</properties>
</leafNode>
diff --git a/interface-definitions/interfaces-wireguard.xml.in b/interface-definitions/interfaces-wireguard.xml.in
index 73328c16a..54f4233c2 100644
--- a/interface-definitions/interfaces-wireguard.xml.in
+++ b/interface-definitions/interfaces-wireguard.xml.in
@@ -99,6 +99,7 @@
</valueHelp>
<constraint>
<validator name="ip-address"/>
+ <validator name="ipv6-link-local"/>
</constraint>
</properties>
</leafNode>
diff --git a/src/validators/ipv6-link-local b/src/validators/ipv6-link-local
new file mode 100755
index 000000000..05e693b77
--- /dev/null
+++ b/src/validators/ipv6-link-local
@@ -0,0 +1,12 @@
+#!/usr/bin/python3
+
+import sys
+from vyos.validate import is_ipv6_link_local
+
+if __name__ == '__main__':
+ if len(sys.argv)>1:
+ addr = sys.argv[1]
+ if not is_ipv6_link_local(addr):
+ sys.exit(1)
+
+ sys.exit(0)