From b931612b5d74e198377df9d54edb1dd024451e5a Mon Sep 17 00:00:00 2001 From: Stig Thormodsrud Date: Wed, 21 May 2008 15:17:33 -0700 Subject: Fix 3155: setting the third vrrp member with the highest priority doesn't change (update) the backup --- scripts/keepalived/VyattaKeepalived.pm | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'scripts/keepalived/VyattaKeepalived.pm') diff --git a/scripts/keepalived/VyattaKeepalived.pm b/scripts/keepalived/VyattaKeepalived.pm index c5abdc97..78421723 100755 --- a/scripts/keepalived/VyattaKeepalived.pm +++ b/scripts/keepalived/VyattaKeepalived.pm @@ -37,6 +37,17 @@ my $keepalived_pid = '/var/run/keepalived_vrrp.pid'; my $state_dir = '/var/log/vrrpd'; my $vrrp_log = "$state_dir/vrrp.log"; +sub snoop_for_master { + my ($intf, $group, $vip, $timeout) = @_; + + my $file = get_master_file($intf, $group); + + 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 $options = "-a duration:$timeout -p -i$intf -c1 -T pdml"; + my $cmd = "tshark $options $cap_filt $dis_filt"; + system("$cmd > $file 2> /dev/null"); +} sub vrrp_log { my $timestamp = strftime("%Y%m%d-%H:%M.%S", localtime); -- cgit v1.2.3