summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2024-02-12 06:26:33 +0100
committerGitHub <noreply@github.com>2024-02-12 06:26:33 +0100
commit3234c16803f4f578c65f3d426e3ca0d00c626711 (patch)
tree6009d9388929b87bb3ee4d768df1a0946dc77dd4 /src
parentb818555726b6945ce5f095e113041765a2e0163a (diff)
parentcafd8840dfeda5cac5f723716c0b234935284856 (diff)
downloadvyos-1x-3234c16803f4f578c65f3d426e3ca0d00c626711.tar.gz
vyos-1x-3234c16803f4f578c65f3d426e3ca0d00c626711.zip
Merge pull request #2990 from vyos/mergify/bp/sagitta/pr-2980
srv6: T5849: add segment support to "protocols static route6" (backport #2980)
Diffstat (limited to 'src')
-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
+