summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2024-02-10 10:02:47 +0100
committerChristian Breunig <christian@breunig.cc>2024-02-11 09:18:58 +0100
commitb84f7de453f3951945298d95a8a27345ba7d28c3 (patch)
tree452a2d38ea0804e46d5e21fc56ac858182aafa9a /src
parentffca244d5c38655ce915cee373e3d6f6c9292954 (diff)
downloadvyos-1x-b84f7de453f3951945298d95a8a27345ba7d28c3.tar.gz
vyos-1x-b84f7de453f3951945298d95a8a27345ba7d28c3.zip
srv6: T5849: add segment support to "protocols static route6"
* set protocols static route6 <prefix> next-hop <address> segments 'x:x::x:x/y:y::y/z::z' * set protocols static route6 <prefix> interface <interface> segments 'x:x::x:x/y:y::y/z::z'
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
+