summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRenato Botelho <garga@FreeBSD.org>2014-09-10 15:23:39 -0300
committerRenato Botelho <garga@FreeBSD.org>2014-09-10 15:39:56 -0300
commitbe32a003afd114098e8cfe7c18edae887810500f (patch)
tree4aed18a158a814569b06c0bd30b68d9ada382f67
parent7397f64315e8ca55db1b8823b3e6d1f987508c62 (diff)
downloadpfsense-be32a003afd114098e8cfe7c18edae887810500f.zip
pfsense-be32a003afd114098e8cfe7c18edae887810500f.tar.gz
Delete IP Alias on CARP VIP interface on secondary node when it's deleted on primary. It fixes #3855
-rwxr-xr-xusr/local/www/xmlrpc.php17
1 files changed, 10 insertions, 7 deletions
diff --git a/usr/local/www/xmlrpc.php b/usr/local/www/xmlrpc.php
index 50746e5..6620221 100755
--- a/usr/local/www/xmlrpc.php
+++ b/usr/local/www/xmlrpc.php
@@ -203,7 +203,7 @@ function restore_config_section_xmlrpc($raw_params) {
if ($vip['mode'] == "carp")
$oldvips["{$vip['interface']}_vip{$vip['vhid']}"] = "{$vip['password']}{$vip['advskew']}{$vip['subnet']}{$vip['subnet_bits']}{$vip['advbase']}";
else if ($vip['mode'] == "ipalias" && (strstr($vip['interface'], "_vip") || strstr($vip['interface'], "lo0")))
- $oldvips[$vip['subnet']] = "{$vip['interface']}{$vip['subnet']}{$vip['subnet_bits']}";
+ $oldvips[$vip['subnet']] = $vip;
else if (($vip['mode'] == "ipalias" || $vip['mode'] == 'proxyarp') && !(strstr($vip['interface'], "_vip") || strstr($vip['interface'], "lo0")))
$vipbackup[] = $vip;
}
@@ -244,11 +244,12 @@ function restore_config_section_xmlrpc($raw_params) {
}
unset($oldvips["{$vip['interface']}_vip{$vip['vhid']}"]);
} else if ($vip['mode'] == "ipalias" && strstr($vip['interface'], "_vip") && isset($oldvips[$vip['subnet']])) {
- if ($oldvips[$vip['subnet']] == "{$vip['interface']}{$vip['subnet']}{$vip['subnet_bits']}") {
- if (does_vip_exist($vip)) {
+ if ($oldvips[$vip['subnet']]['interface'] == $vip['interface'] &&
+ $oldvips[$vip['subnet']]['subnet'] == $vip['subnet'] &&
+ $oldvips[$vip['subnet']]['subnet_bits'] == $vip['subnet_bits'] &&
+ does_vip_exist($vip)) {
unset($oldvips[$vip['subnet']]);
continue; // Skip reconfiguring this vips since nothing has changed.
- }
}
unset($oldvips[$vip['subnet']]);
}
@@ -267,10 +268,12 @@ function restore_config_section_xmlrpc($raw_params) {
break;
}
}
- /* Cleanup remaining old carps */
+ /* Cleanup remaining old carps and ipalias */
foreach ($oldvips as $oldvipif => $oldvippar) {
- if (!is_ipaddr($oldvipif) && does_interface_exist($oldvipif))
- pfSense_interface_destroy($oldvipif);
+ if (is_ipaddr($oldvipif))
+ interface_vip_bring_down($oldvippar);
+ else if (does_interface_exist($oldvipif))
+ pfSense_interface_destroy($oldvipif);
}
if ($carp_setuped == true)
interfaces_carp_setup();
OpenPOWER on IntegriCloud