summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStig Thormodsrud <stig@vyatta.com>2009-06-14 14:14:49 -0700
committerStig Thormodsrud <stig@vyatta.com>2009-06-14 14:28:53 -0700
commit11823917831a50a0ce4f7d8037a0814e8bb3f342 (patch)
tree4db281ec60e380dbeff5cb184b5dc5ae01a2c61f
parentb0bec8f21547792d8f94a4b65302b976bc836adb (diff)
downloadvyatta-cfg-quagga-11823917831a50a0ce4f7d8037a0814e8bb3f342.tar.gz
vyatta-cfg-quagga-11823917831a50a0ce4f7d8037a0814e8bb3f342.zip
Fix 4579: There is no validation for vrrp virtual-address like the one for interfaces address.
-rw-r--r--templates/interfaces/ethernet/node.tag/vif/node.tag/vrrp/vrrp-group/node.tag/virtual-address/node.def11
-rw-r--r--templates/interfaces/ethernet/node.tag/vrrp/vrrp-group/node.tag/virtual-address/node.def11
2 files changed, 22 insertions, 0 deletions
diff --git a/templates/interfaces/ethernet/node.tag/vif/node.tag/vrrp/vrrp-group/node.tag/virtual-address/node.def b/templates/interfaces/ethernet/node.tag/vif/node.tag/vrrp/vrrp-group/node.tag/virtual-address/node.def
index 363240cd..176287aa 100644
--- a/templates/interfaces/ethernet/node.tag/vif/node.tag/vrrp/vrrp-group/node.tag/virtual-address/node.def
+++ b/templates/interfaces/ethernet/node.tag/vif/node.tag/vrrp/vrrp-group/node.tag/virtual-address/node.def
@@ -6,6 +6,17 @@ syntax:expression: exec "/opt/vyatta/sbin/vyatta-keepalived.pl \
--vrrp-action='check-vip' --vip='$VAR(@)' "\
; "Invalid virtual-address [$VAR(@)] for vrrp-group $VAR(../@)"
+syntax:expression: exec "
+ if echo '$VAR(@)' | grep -q '/' ; then
+ if /opt/vyatta/sbin/vyatta-interfaces.pl \
+ --valid-addr $VAR(@) --dev $VAR(../../../@) ; then
+ exit 0
+ else
+ echo Invalid vrrp virtual-address [$VAR(@)] for vrrp-group $VAR(../@)
+ exit 1
+ fi
+ fi"
+
comp_help: possible completions:
<x.x.x.x> Virtual IP address (up to 20 per group)
<x.x.x.x/x> Virtual IP address with prefix (up to 20 per group)
diff --git a/templates/interfaces/ethernet/node.tag/vrrp/vrrp-group/node.tag/virtual-address/node.def b/templates/interfaces/ethernet/node.tag/vrrp/vrrp-group/node.tag/virtual-address/node.def
index 363240cd..176287aa 100644
--- a/templates/interfaces/ethernet/node.tag/vrrp/vrrp-group/node.tag/virtual-address/node.def
+++ b/templates/interfaces/ethernet/node.tag/vrrp/vrrp-group/node.tag/virtual-address/node.def
@@ -6,6 +6,17 @@ syntax:expression: exec "/opt/vyatta/sbin/vyatta-keepalived.pl \
--vrrp-action='check-vip' --vip='$VAR(@)' "\
; "Invalid virtual-address [$VAR(@)] for vrrp-group $VAR(../@)"
+syntax:expression: exec "
+ if echo '$VAR(@)' | grep -q '/' ; then
+ if /opt/vyatta/sbin/vyatta-interfaces.pl \
+ --valid-addr $VAR(@) --dev $VAR(../../../@) ; then
+ exit 0
+ else
+ echo Invalid vrrp virtual-address [$VAR(@)] for vrrp-group $VAR(../@)
+ exit 1
+ fi
+ fi"
+
comp_help: possible completions:
<x.x.x.x> Virtual IP address (up to 20 per group)
<x.x.x.x/x> Virtual IP address with prefix (up to 20 per group)