diff options
author | Stig Thormodsrud <stig@vyatta.com> | 2008-05-21 15:17:33 -0700 |
---|---|---|
committer | Stig Thormodsrud <stig@vyatta.com> | 2008-05-21 15:17:33 -0700 |
commit | b931612b5d74e198377df9d54edb1dd024451e5a (patch) | |
tree | 796cd0edf80209d10c6c72723053f8deb8c6b8fc /scripts/keepalived/vyatta-vrrp-state.pl | |
parent | 23b8861ec98052cf8af9950b33b75a7356c7d2a4 (diff) | |
download | vyatta-cfg-quagga-b931612b5d74e198377df9d54edb1dd024451e5a.tar.gz vyatta-cfg-quagga-b931612b5d74e198377df9d54edb1dd024451e5a.zip |
Fix 3155: setting the third vrrp member with the highest priority doesn't change (update) the backup
Diffstat (limited to 'scripts/keepalived/vyatta-vrrp-state.pl')
-rwxr-xr-x | scripts/keepalived/vyatta-vrrp-state.pl | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/scripts/keepalived/vyatta-vrrp-state.pl b/scripts/keepalived/vyatta-vrrp-state.pl index 2f3554d9..a3be3095 100755 --- a/scripts/keepalived/vyatta-vrrp-state.pl +++ b/scripts/keepalived/vyatta-vrrp-state.pl @@ -31,15 +31,6 @@ use strict; use warnings; -sub snoop_for_master { - my ($intf, $group, $vip, $file) = @_; - - my $cap_filt = "-f \"host 224.0.0.18 and proto VRRP\""; - my $dis_filt = "-R \"vrrp.virt_rtr_id == $group and vrrp.ip_addr == $vip\""; - my $cmd = "tshark -a duration:60 -p -i$intf -c1 -T pdml $cap_filt $dis_filt"; - system("$cmd > $file 2> /dev/null"); -} - sub vrrp_state_log { my ($state, $intf, $group) = @_; @@ -69,14 +60,15 @@ if (defined $old_state and $vrrp_state eq $old_state) { # restarts call the transition script even if it really hasn't # changed. # + VyattaKeepalived::vrrp_log("$vrrp_intf $vrrp_group same - $vrrp_state"); exit 0; } VyattaKeepalived::vrrp_log("$vrrp_intf $vrrp_group transition to $vrrp_state"); vrrp_state_log($vrrp_state, $vrrp_intf, $vrrp_group); -my $mfile = VyattaKeepalived::get_master_file($vrrp_intf, $vrrp_group); if ($vrrp_state eq "backup") { - snoop_for_master($vrrp_intf, $vrrp_group, $vrrp_vips[0], $mfile); + VyattaKeepalived::snoop_for_master($vrrp_intf, $vrrp_group, $vrrp_vips[0], + 60); } elsif ($vrrp_state eq "master") { # # keepalived will send gratuitous arp requests on master transition @@ -91,15 +83,14 @@ if ($vrrp_state eq "backup") { # # remove the old master file since we are now master # + my $mfile = VyattaKeepalived::get_master_file($vrrp_intf, $vrrp_group); system("rm -f $mfile"); } - if (!($vrrp_transitionscript eq "null")){ exec("$vrrp_transitionscript"); } - exit 0; # end of file |