diff options
author | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2010-11-23 15:12:02 -0800 |
---|---|---|
committer | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2010-11-23 15:12:02 -0800 |
commit | 1e3cbfb3c29d9a0e4390e7901551a592d981489b (patch) | |
tree | 0059121818c5496fe4f0b28766e3e560fce4eb2c /templates | |
parent | ab1c18fa483f99206e52347a41b66e3f52ccd748 (diff) | |
download | vyatta-cfg-system-1e3cbfb3c29d9a0e4390e7901551a592d981489b.tar.gz vyatta-cfg-system-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')
4 files changed, 16 insertions, 48 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) 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 28f085e5..d86675ec 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 @@ -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/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 28f085e5..d86675ec 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 @@ -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) |