summaryrefslogtreecommitdiff
path: root/scripts/keepalived/VyattaKeepalived.pm
diff options
context:
space:
mode:
authorStig Thormodsrud <stig@vyatta.com>2008-05-21 15:17:33 -0700
committerStig Thormodsrud <stig@vyatta.com>2008-05-21 15:17:33 -0700
commitb931612b5d74e198377df9d54edb1dd024451e5a (patch)
tree796cd0edf80209d10c6c72723053f8deb8c6b8fc /scripts/keepalived/VyattaKeepalived.pm
parent23b8861ec98052cf8af9950b33b75a7356c7d2a4 (diff)
downloadvyatta-cfg-system-b931612b5d74e198377df9d54edb1dd024451e5a.tar.gz
vyatta-cfg-system-b931612b5d74e198377df9d54edb1dd024451e5a.zip
Fix 3155: setting the third vrrp member with the highest priority doesn't change (update) the backup
Diffstat (limited to 'scripts/keepalived/VyattaKeepalived.pm')
-rwxr-xr-xscripts/keepalived/VyattaKeepalived.pm11
1 files changed, 11 insertions, 0 deletions
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);