From cafd8840dfeda5cac5f723716c0b234935284856 Mon Sep 17 00:00:00 2001 From: Christian Breunig Date: Sat, 10 Feb 2024 10:02:47 +0100 Subject: srv6: T5849: add segment support to "protocols static route6" * set protocols static route6 next-hop
segments 'x:x::x:x/y:y::y/z::z' * set protocols static route6 interface segments 'x:x::x:x/y:y::y/z::z' (cherry picked from commit b84f7de453f3951945298d95a8a27345ba7d28c3) --- src/validators/ipv6-srv6-segments | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100755 src/validators/ipv6-srv6-segments (limited to 'src/validators') 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 + -- cgit v1.2.3