summaryrefslogtreecommitdiff
path: root/lib/Vyatta/Keepalived.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Vyatta/Keepalived.pm')
-rwxr-xr-xlib/Vyatta/Keepalived.pm6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/Vyatta/Keepalived.pm b/lib/Vyatta/Keepalived.pm
index 5267d102..1f3c2592 100755
--- a/lib/Vyatta/Keepalived.pm
+++ b/lib/Vyatta/Keepalived.pm
@@ -157,12 +157,14 @@ sub vrrp_get_config {
if (!defined $primary_addr) {
$primary_addr = "0.0.0.0";
}
-
if ($primary_addr =~ m/(\d+\.\d+\.\d+\.\d+)\/\d+/) {
- $primary_addr = $1;
+ $primary_addr = $1; # strip /mask
}
$config->setLevel("$path vrrp vrrp-group $group");
+ my $source_addr = $config->returnOrigValue("hello-source-address");
+ $primary_addr = $source_addr if defined $source_addr;
+
my @vips = $config->returnOrigValues("virtual-address");
my $priority = $config->returnOrigValue("priority");
if (!defined $priority) {