summaryrefslogtreecommitdiff
path: root/src/validators
diff options
context:
space:
mode:
authorDaniil Baturin <daniil@vyos.io>2024-02-11 23:46:27 +0000
committerGitHub <noreply@github.com>2024-02-11 23:46:27 +0000
commitbf595a899ae192f24793374978f44d31fa43d195 (patch)
tree840bdfd3e7d2d9e64c27e6893c9bffeaf5dbd593 /src/validators
parent1d0c97f7b13ef1e4c857d64dc968c5f284e5d1ad (diff)
parentb84f7de453f3951945298d95a8a27345ba7d28c3 (diff)
downloadvyos-1x-bf595a899ae192f24793374978f44d31fa43d195.tar.gz
vyos-1x-bf595a899ae192f24793374978f44d31fa43d195.zip
Merge pull request #2980 from c-po/srv6-T5849
srv6: T5849: add segment support to "protocols static route6"
Diffstat (limited to 'src/validators')
-rwxr-xr-xsrc/validators/ipv6-srv6-segments13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/validators/ipv6-srv6-segments b/src/validators/ipv6-srv6-segments
new file mode 100755
index 000000000..e72a4f90f
--- /dev/null
+++ b/src/validators/ipv6-srv6-segments
@@ -0,0 +1,13 @@
+#!/bin/sh
+segments="$1"
+export IFS="/"
+
+for ipv6addr in $segments; do
+ ipaddrcheck --is-ipv6-single $ipv6addr
+ if [ $? -gt 0 ]; then
+ echo "Error: $1 is not a valid IPv6 address"
+ exit 1
+ fi
+done
+exit 0
+