diff options
author | Stig Thormodsrud <stig@vyatta.com> | 2008-05-19 11:20:36 -0700 |
---|---|---|
committer | Stig Thormodsrud <stig@vyatta.com> | 2008-05-19 11:20:36 -0700 |
commit | 5b160a324927a457c8ddbd90afada3523b189a43 (patch) | |
tree | b0684a729d4688af6a6f742ab8bc98947b4c7fa5 | |
parent | 0bdc207f65ebdd10f49b6d05f03e866a52955c71 (diff) | |
download | vyatta-cfg-system-5b160a324927a457c8ddbd90afada3523b189a43.tar.gz vyatta-cfg-system-5b160a324927a457c8ddbd90afada3523b189a43.zip |
Fix 3251: vrrp should also send a gratuitous arp reply on master transition
-rw-r--r-- | debian/control | 3 | ||||
-rwxr-xr-x | scripts/keepalived/vyatta-vrrp-state.pl | 20 |
2 files changed, 20 insertions, 3 deletions
diff --git a/debian/control b/debian/control index 615b5050..1f63a6ce 100644 --- a/debian/control +++ b/debian/control @@ -26,7 +26,8 @@ Depends: sed (>= 4.1.5), bridge-utils, ssh, ed, - tshark + tshark, + iputils-arping Suggests: util-linux (>= 2.13-5), net-tools, ethtool, diff --git a/scripts/keepalived/vyatta-vrrp-state.pl b/scripts/keepalived/vyatta-vrrp-state.pl index 9e11b649..2f3554d9 100755 --- a/scripts/keepalived/vyatta-vrrp-state.pl +++ b/scripts/keepalived/vyatta-vrrp-state.pl @@ -56,7 +56,10 @@ my $vrrp_state = $ARGV[0]; my $vrrp_intf = $ARGV[1]; my $vrrp_group = $ARGV[2]; my $vrrp_transitionscript = $ARGV[3]; -my $vrrp_vip = $ARGV[4]; +my @vrrp_vips; +foreach my $arg (4 .. $#ARGV) { + push @vrrp_vips, $ARGV[$arg]; +} my $sfile = VyattaKeepalived::get_state_file($vrrp_intf, $vrrp_group); my ($old_time, $old_intf, $old_group, $old_state, $old_ltime) = @@ -73,8 +76,21 @@ 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_vip, $mfile); + snoop_for_master($vrrp_intf, $vrrp_group, $vrrp_vips[0], $mfile); } elsif ($vrrp_state eq "master") { + # + # keepalived will send gratuitous arp requests on master transition + # but some hosts do not update their arp cache for gratuitous arp + # requests. Some of those host do respond to gratuitous arp replies + # so here we will send 5 gratuitous arp replies also. + # + foreach my $vip (@vrrp_vips) { + system("/usr/bin/arping -A -c5 -I $vrrp_intf $vip"); + } + + # + # remove the old master file since we are now master + # system("rm -f $mfile"); } |