summaryrefslogtreecommitdiff
path: root/scripts/keepalived/vyatta-clear-vrrp.pl
diff options
context:
space:
mode:
authorDavid S. Madole <david@omd3.com>2009-09-27 15:29:17 -0400
committerStig Thormodsrud <stig@vyatta.com>2009-10-31 12:52:35 -0700
commit1b8212fe55cc9d83601acc52b43d3e7116542eda (patch)
tree44308d0726619ddc3f9575080b31f776cb471c30 /scripts/keepalived/vyatta-clear-vrrp.pl
parent5d2999ffb3a93966091c095cc85446ec62834c0f (diff)
downloadvyatta-cfg-quagga-1b8212fe55cc9d83601acc52b43d3e7116542eda.tar.gz
vyatta-cfg-quagga-1b8212fe55cc9d83601acc52b43d3e7116542eda.zip
Add VRRP capability to bonding interfaces and vifs of bonding interfaces.
Diffstat (limited to 'scripts/keepalived/vyatta-clear-vrrp.pl')
-rw-r--r--scripts/keepalived/vyatta-clear-vrrp.pl75
1 files changed, 39 insertions, 36 deletions
diff --git a/scripts/keepalived/vyatta-clear-vrrp.pl b/scripts/keepalived/vyatta-clear-vrrp.pl
index 17dedc59..ba5d569b 100644
--- a/scripts/keepalived/vyatta-clear-vrrp.pl
+++ b/scripts/keepalived/vyatta-clear-vrrp.pl
@@ -109,47 +109,50 @@ sub get_vrrp_intf_group {
# return an array of hashes that contains all the intf/group pairs
#
- my $config = new Vyatta::Config;
- $config->setLevel('interfaces ethernet');
- my @eths = $config->listOrigNodes();
- foreach my $eth (@eths) {
- my $path = "interfaces ethernet $eth";
- $config->setLevel($path);
- if ($config->existsOrig("vrrp")) {
- $path = "$path vrrp vrrp-group";
+ foreach my $type (("ethernet", "bonding")) {
+
+ my $config = new Vyatta::Config;
+ $config->setLevel("interfaces $type");
+ my @eths = $config->listOrigNodes();
+ foreach my $eth (@eths) {
+ my $path = "interfaces $type $eth";
$config->setLevel($path);
- my @groups = $config->listOrigNodes();
- foreach my $group (@groups) {
- my %hash;
- $hash{'intf'} = $eth;
- $hash{'group'} = $group;
- $hash{'path'} = "$path $group";
- push @array, {%hash};
+ if ($config->existsOrig("vrrp")) {
+ $path = "$path vrrp vrrp-group";
+ $config->setLevel($path);
+ my @groups = $config->listOrigNodes();
+ foreach my $group (@groups) {
+ my %hash;
+ $hash{'intf'} = $eth;
+ $hash{'group'} = $group;
+ $hash{'path'} = "$path $group";
+ push @array, {%hash};
+ }
}
- }
- $path = "interfaces ethernet $eth";
- $config->setLevel($path);
- if ($config->existsOrig('vif')) {
- my $path = "$path vif";
+ $path = "interfaces $type $eth";
$config->setLevel($path);
- my @vifs = $config->listOrigNodes();
- foreach my $vif (@vifs) {
- my $vif_intf = $eth . '.' . $vif;
- my $vif_path = "$path $vif";
- $config->setLevel($vif_path);
- if ($config->existsOrig('vrrp')) {
- $vif_path = "$vif_path vrrp vrrp-group";
+ if ($config->existsOrig('vif')) {
+ my $path = "$path vif";
+ $config->setLevel($path);
+ my @vifs = $config->listOrigNodes();
+ foreach my $vif (@vifs) {
+ my $vif_intf = $eth . '.' . $vif;
+ my $vif_path = "$path $vif";
$config->setLevel($vif_path);
- my @groups = $config->listOrigNodes();
- foreach my $group (@groups) {
- my %hash;
- $hash{'intf'} = $vif_intf;
- $hash{'group'} = $group;
- $hash{'path'} = "$path $group";
- push @array, {%hash};
- }
- }
+ if ($config->existsOrig('vrrp')) {
+ $vif_path = "$vif_path vrrp vrrp-group";
+ $config->setLevel($vif_path);
+ my @groups = $config->listOrigNodes();
+ foreach my $group (@groups) {
+ my %hash;
+ $hash{'intf'} = $vif_intf;
+ $hash{'group'} = $group;
+ $hash{'path'} = "$path $group";
+ push @array, {%hash};
+ }
+ }
+ }
}
}
}