summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorDaniil Baturin <daniil@vyos.io>2020-06-25 09:57:14 +0300
committerDaniil Baturin <daniil@vyos.io>2020-06-25 09:57:14 +0300
commit7c719556bdee7c7e965c0b1eb4f182704ee1c6fd (patch)
tree36db6e0dc3485313fd13a296b176829f4a3664d1 /templates
parent1bdea7cedaca5ec6949a0942517e36ae185eb85c (diff)
downloadvyatta-cfg-quagga-7c719556bdee7c7e965c0b1eb4f182704ee1c6fd.tar.gz
vyatta-cfg-quagga-7c719556bdee7c7e965c0b1eb4f182704ee1c6fd.zip
T1665: correctly validate prefix-list and access-list networks.
Diffstat (limited to 'templates')
-rw-r--r--templates/policy/access-list6/node.tag/rule/node.tag/source/network/node.def3
-rw-r--r--templates/policy/prefix-list/node.tag/rule/node.tag/prefix/node.def3
-rw-r--r--templates/policy/prefix-list6/node.tag/rule/node.tag/prefix/node.def3
3 files changed, 6 insertions, 3 deletions
diff --git a/templates/policy/access-list6/node.tag/rule/node.tag/source/network/node.def b/templates/policy/access-list6/node.tag/rule/node.tag/source/network/node.def
index eb97e759..5bcc816c 100644
--- a/templates/policy/access-list6/node.tag/rule/node.tag/source/network/node.def
+++ b/templates/policy/access-list6/node.tag/rule/node.tag/source/network/node.def
@@ -1,4 +1,5 @@
-type: ipv6net
+type: txt
+syntax:expression: exec "${vyos_libexec_dir}/validate-value --exec \"${vyos_validators_dir}/ipv6-prefix \" --value \'$VAR(@)\'"; "$VAR(@) is not a valid IPv6 network address"
help: Network/netmask to match (requires inverse-mask be defined)
val_help: IPv6 address and prefix length
commit:expression: ($VAR(../any/) == ""); "you may only define one filter type. (network|any)"
diff --git a/templates/policy/prefix-list/node.tag/rule/node.tag/prefix/node.def b/templates/policy/prefix-list/node.tag/rule/node.tag/prefix/node.def
index 89e8e805..d0dacbc8 100644
--- a/templates/policy/prefix-list/node.tag/rule/node.tag/prefix/node.def
+++ b/templates/policy/prefix-list/node.tag/rule/node.tag/prefix/node.def
@@ -1,3 +1,4 @@
-type: ipv4net
+type: txt
+syntax:expression: exec "${vyos_libexec_dir}/validate-value --exec \"${vyos_validators_dir}/ipv4-prefix \" --value \'$VAR(@)\'"; "$VAR(@) is not a valid IPv4 network prefix"
help: Prefix to match
val_help: Prefix to match against
diff --git a/templates/policy/prefix-list6/node.tag/rule/node.tag/prefix/node.def b/templates/policy/prefix-list6/node.tag/rule/node.tag/prefix/node.def
index f78d4f0f..1955e6a8 100644
--- a/templates/policy/prefix-list6/node.tag/rule/node.tag/prefix/node.def
+++ b/templates/policy/prefix-list6/node.tag/rule/node.tag/prefix/node.def
@@ -1,3 +1,4 @@
-type: ipv6net
+type: txt
+syntax:expression: exec "${vyos_libexec_dir}/validate-value --exec \"${vyos_validators_dir}/ipv6-prefix \" --value \'$VAR(@)\'"; "$VAR(@) is not a valid IPv6 network address"
help: Prefix to match
val_help: IPv6 prefix