summaryrefslogtreecommitdiff
path: root/src/validators
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2021-03-17 20:09:11 +0100
committerChristian Poessinger <christian@poessinger.com>2021-03-17 20:09:11 +0100
commit6f6cd6552384704700f08e9367e167796b1f7fde (patch)
treed47275cf5aedcd55d919245e8a290c8d371382fe /src/validators
parentb9ba3c08736b63c2455c06e6f36108128776fa00 (diff)
downloadvyos-1x-6f6cd6552384704700f08e9367e167796b1f7fde.tar.gz
vyos-1x-6f6cd6552384704700f08e9367e167796b1f7fde.zip
ipv6: eui64: T3413: add custom validator
VyOS 1.2 (crux) rejected prefixes other then of site /64. [ interfaces ethernet eth0 ipv6 address eui64 2006:ab00:abe1::2/127 ] Error: Prefix lenght is 127. It must be 64. Same should be done on VyOS 1.3 and newer
Diffstat (limited to 'src/validators')
-rwxr-xr-xsrc/validators/ipv6-eui64-prefix16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/validators/ipv6-eui64-prefix b/src/validators/ipv6-eui64-prefix
new file mode 100755
index 000000000..d7f262633
--- /dev/null
+++ b/src/validators/ipv6-eui64-prefix
@@ -0,0 +1,16 @@
+#!/usr/bin/env python3
+
+# Validator used to check if given IPv6 prefix is of size /64 required by EUI64
+
+from sys import argv
+from sys import exit
+
+if __name__ == '__main__':
+ if len(argv) != 2:
+ exit(1)
+
+ prefix = argv[1]
+ if prefix.split('/')[1] == '64':
+ exit(0)
+
+ exit(1)