From 9b527a7931795466ab7286f0caadd7bef082d002 Mon Sep 17 00:00:00 2001 From: Renato Botelho Date: Thu, 22 Jan 2015 10:01:19 -0200 Subject: Make sure radvd is reconfigured when CARP is enabled/disabled. It should fix #4252 --- usr/local/www/carp_status.php | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'usr/local/www/carp_status.php') diff --git a/usr/local/www/carp_status.php b/usr/local/www/carp_status.php index 2a338b2..1a3df8a 100644 --- a/usr/local/www/carp_status.php +++ b/usr/local/www/carp_status.php @@ -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; } -- cgit v1.1