break; } } $savemsg = sprintf(gettext("%s IPs have been disabled. Please note that disabling does not survive a reboot."), $carp_counter); } else { $savemsg = gettext("CARP has been enabled."); foreach ($a_vip as $vip) { switch ($vip['mode']) { case "carp": interface_carp_configure($vip); sleep(1); break; } } interfaces_carp_setup(); set_single_sysctl('net.inet.carp.allow', '1'); } } } $carpcount = 0; foreach ($a_vip as $carp) { if ($carp['mode'] == "carp") { $carpcount++; break; } } // fetch pfsync info $pfsyncnodes = json_decode(configd_run("filter list pfsync json"), true); legacy_html_escape_form_data($a_vip); $status = get_single_sysctl('net.inet.carp.allow') > 0; $carp_detected_problems = array_pop(get_sysctl("net.inet.carp.demotion")) > 0;
interface_proxyarp_configure($a_vip[$vid]['interface']); break; case "carp": $check_carp = true; interface_carp_configure($a_vip[$vid]); break; default: break; } } } @unlink("{$g['tmp_path']}/.firewall_virtual_ip.apply"); } /* Before changing check #4633 */ if ($check_carp === true && !get_carp_status()) { set_single_sysctl("net.inet.carp.allow", "1"); } $retval = 0; $retval |= filter_configure(); $savemsg = get_std_save_message($retval); clear_subsystem_dirty('vip'); } } if ($_GET['act'] == "del") { if ($a_vip[$_GET['id']]) { /* make sure no inbound NAT mappings reference this entry */ if (is_array($config['nat']['rule'])) { foreach ($config['nat']['rule'] as $rule) { if ($rule['destination']['address'] != "") { if ($rule['destination']['address'] == $a_vip[$_GET['id']]['subnet']) { $input_errors[] = gettext("This entry cannot be deleted because it is still referenced by at least one NAT mapping.");
case 'ipalias': if (substr($vip['interface'], 0, 4) == "_vip") { interface_ipalias_configure($vip); } break; } } } interfaces_sync_setup(); set_single_sysctl('net.inet.carp.allow', '1'); $status = 1; } } $carp_detected_problems = get_single_sysctl("net.inet.carp.demotion"); if (!empty($_POST['resetdemotion'])) { set_single_sysctl("net.inet.carp.demotion", "-{$carp_detected_problems}"); sleep(1); $carp_detected_problems = get_single_sysctl("net.inet.carp.demotion"); } $pgtitle = array(gettext("Status"), gettext("CARP")); $shortcut_section = "carp"; include "head.inc"; if ($savemsg) { print_info_box($savemsg, 'success'); } $carpcount = 0; if (is_array($config['virtualip']['vip'])) { foreach ($config['virtualip']['vip'] as $carp) { if ($carp['mode'] == "carp") { $carpcount++; break;