Make sure radvd is reconfigured when CARP is enabled/disabled. It should fix #4252

This commit is contained in:
Renato Botelho 2015-01-22 10:01:19 -02:00
parent b711bfac32
commit 8e24d1dacd
1 changed files with 18 additions and 1 deletions

View File

@ -60,11 +60,28 @@ if($_POST['disablecarp'] <> "") {
set_single_sysctl('net.inet.carp.allow', '0');
if(is_array($config['virtualip']['vip'])) {
$viparr = &$config['virtualip']['vip'];
$found_dhcpdv6 = false;
foreach ($viparr as $vip) {
$carp_iface = "{$vip['interface']}_vip{$vip['vhid']}";
switch ($vip['mode']) {
case "carp":
interface_vip_bring_down($vip);
interface_ipalias_cleanup("{$vip['interface']}_vip{$vip['vhid']}");
interface_ipalias_cleanup($carp_iface);
/*
* Reconfigure radvd when necessary
* XXX: Is it the best way to do it?
*/
if (isset($config['dhcpdv6']) && is_array($config['dhcpdv6'])) {
foreach ($config['dhcpdv6'] as $dhcpv6if => $dhcpv6ifconf) {
if ($dhcpv6ifconf['rainterface'] != $carp_iface)
continue;
services_radvd_configure();
break;
}
}
sleep(1);
break;
}