summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStig Thormodsrud <stig@vyatta.com>2010-12-10 14:44:35 -0800
committerStig Thormodsrud <stig@vyatta.com>2010-12-10 14:44:35 -0800
commite67e29be711a9d3aec9b5aae5b1816b485b559d5 (patch)
tree86005328b14baa83aeb6574bf719702801f8050f
parent37a1b4d8587dbfa30cc0d1e4dae922ee9e817a7d (diff)
downloadvyatta-cfg-e67e29be711a9d3aec9b5aae5b1816b485b559d5.tar.gz
vyatta-cfg-e67e29be711a9d3aec9b5aae5b1816b485b559d5.zip
Return configured address in vrrp_get_config().
-rwxr-xr-xlib/Vyatta/Keepalived.pm9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/Vyatta/Keepalived.pm b/lib/Vyatta/Keepalived.pm
index fb575a1..15f2db2 100755
--- a/lib/Vyatta/Keepalived.pm
+++ b/lib/Vyatta/Keepalived.pm
@@ -186,6 +186,9 @@ sub get_state_files {
return @state_files;
}
+#
+# this is meant to be called from op mode, so Orig functions are used.
+#
sub vrrp_get_config {
my ($intf, $group) = @_;
@@ -197,9 +200,11 @@ sub vrrp_get_config {
$path = $interface->path();
$config->setLevel($path);
- my @addr = getIP($intf, 4);
+ # don't use getIP() to get IP addresses because we only
+ # want configured addresses, not vrrp VIP addresses.
+ my @addr = $config->returnOrigValues('address');
my $primary_addr = shift @addr;
- if (!defined $primary_addr) {
+ if (!defined $primary_addr or $primary_addr eq 'dhcp') {
$primary_addr = "0.0.0.0";
}
if ($primary_addr =~ m/(\d+\.\d+\.\d+\.\d+)\/\d+/) {