summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStig Thormodsrud <stig@io.vyatta.com>2009-03-06 20:16:59 -0800
committerStig Thormodsrud <stig@io.vyatta.com>2009-03-06 20:16:59 -0800
commit084e7f10bdcd701c4d2643e5ed286c3d824ba975 (patch)
tree88bac426f7dc35914b37036edd88240ad38ae4dd
parenta9f1badfd6caf89f2c615eb3e8cebb1bddf76445 (diff)
downloadvyatta-cfg-quagga-084e7f10bdcd701c4d2643e5ed286c3d824ba975.tar.gz
vyatta-cfg-quagga-084e7f10bdcd701c4d2643e5ed286c3d824ba975.zip
Remove prefix mask on vip if present since it can't be using in arping.
-rwxr-xr-xlib/Vyatta/Keepalived.pm5
-rwxr-xr-xscripts/keepalived/vyatta-show-vrrp.pl10
2 files changed, 14 insertions, 1 deletions
diff --git a/lib/Vyatta/Keepalived.pm b/lib/Vyatta/Keepalived.pm
index 2c6b2b28..96d4fe90 100755
--- a/lib/Vyatta/Keepalived.pm
+++ b/lib/Vyatta/Keepalived.pm
@@ -201,6 +201,11 @@ sub snoop_for_master {
my $file = get_master_file($intf, $group);
+ # remove mask if vip has one
+ if ($vip =~ /([\d.]+)\/\d+/) {
+ $vip = $1;
+ }
+
#
# set up common tshark parameters
#
diff --git a/scripts/keepalived/vyatta-show-vrrp.pl b/scripts/keepalived/vyatta-show-vrrp.pl
index 25e71bb4..3015bc92 100755
--- a/scripts/keepalived/vyatta-show-vrrp.pl
+++ b/scripts/keepalived/vyatta-show-vrrp.pl
@@ -110,6 +110,11 @@ sub parse_arping {
sub get_master_info {
my ($intf, $group, $vip) = @_;
+ # remove mask if vip has one
+ if ($vip =~ /([\d.]+)\/\d+/) {
+ $vip = $1;
+ }
+
# Calling snoop_for_master() is an expensive operation, so we
# normally only do it on vrrp state transitions by calling the
# vyatta-vrrp-state.pl script. However if there are more than
@@ -123,7 +128,10 @@ sub get_master_info {
my $arp_file = "$master_file.arp";
my $source_ip = (vrrp_get_config($intf, $group))[0];
- # arping doesn't seem to work for vlans, maybe we should skip it if vlan?
+ # arping doesn't seem to work for vlans
+ if ($intf =~ /(eth\d+).\d+/) {
+ $intf = $1;
+ }
system("/usr/bin/arping -c1 -f -I $intf -s $source_ip $vip > $arp_file");
my $arp_mac = parse_arping($arp_file);