summaryrefslogtreecommitdiff
path: root/templates/interfaces/bonding
diff options
context:
space:
mode:
authorStephen Hemminger <stephen.hemminger@vyatta.com>2010-11-23 15:12:02 -0800
committerStephen Hemminger <stephen.hemminger@vyatta.com>2010-11-23 15:12:02 -0800
commit1e3cbfb3c29d9a0e4390e7901551a592d981489b (patch)
tree0059121818c5496fe4f0b28766e3e560fce4eb2c /templates/interfaces/bonding
parentab1c18fa483f99206e52347a41b66e3f52ccd748 (diff)
downloadvyatta-cfg-quagga-1e3cbfb3c29d9a0e4390e7901551a592d981489b.tar.gz
vyatta-cfg-quagga-1e3cbfb3c29d9a0e4390e7901551a592d981489b.zip
Improve performance of syntax checks for vrrp address
Use CLI (ipv4,ipv4net) and new address validator to check addresses for VRRP.
Diffstat (limited to 'templates/interfaces/bonding')
-rw-r--r--templates/interfaces/bonding/node.tag/vif/node.tag/vrrp/vrrp-group/node.tag/virtual-address/node.def16
-rw-r--r--templates/interfaces/bonding/node.tag/vrrp/vrrp-group/node.tag/virtual-address/node.def16
2 files changed, 8 insertions, 24 deletions
diff --git a/templates/interfaces/bonding/node.tag/vif/node.tag/vrrp/vrrp-group/node.tag/virtual-address/node.def b/templates/interfaces/bonding/node.tag/vif/node.tag/vrrp/vrrp-group/node.tag/virtual-address/node.def
index 28f085e5..d86675ec 100644
--- a/templates/interfaces/bonding/node.tag/vif/node.tag/vrrp/vrrp-group/node.tag/virtual-address/node.def
+++ b/templates/interfaces/bonding/node.tag/vif/node.tag/vrrp/vrrp-group/node.tag/virtual-address/node.def
@@ -1,21 +1,13 @@
multi:
-type: txt
+type: ipv4,ipv4net
help: Virtual address [REQUIRED]
+syntax:expression: exec "
+ if [[ '$VAR(@)' == '*/' ]]; then /opt/vyatta/sbin/valid_address $VAR(@); fi"
+
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"
-
val_help: ipv4; Virtual IP address (up to 20 per group)
val_help: ipv4net; Virtual IP address with prefix (up to 20 per group)
diff --git a/templates/interfaces/bonding/node.tag/vrrp/vrrp-group/node.tag/virtual-address/node.def b/templates/interfaces/bonding/node.tag/vrrp/vrrp-group/node.tag/virtual-address/node.def
index 28f085e5..d86675ec 100644
--- a/templates/interfaces/bonding/node.tag/vrrp/vrrp-group/node.tag/virtual-address/node.def
+++ b/templates/interfaces/bonding/node.tag/vrrp/vrrp-group/node.tag/virtual-address/node.def
@@ -1,21 +1,13 @@
multi:
-type: txt
+type: ipv4,ipv4net
help: Virtual address [REQUIRED]
+syntax:expression: exec "
+ if [[ '$VAR(@)' == '*/' ]]; then /opt/vyatta/sbin/valid_address $VAR(@); fi"
+
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"
-
val_help: ipv4; Virtual IP address (up to 20 per group)
val_help: ipv4net; Virtual IP address with prefix (up to 20 per group)