diff --git a/src/etc/inc/interfaces.inc b/src/etc/inc/interfaces.inc index aed6ca8b7..d8cee2130 100644 --- a/src/etc/inc/interfaces.inc +++ b/src/etc/inc/interfaces.inc @@ -4512,7 +4512,11 @@ function interfaces_addresses($interfaces, $as_subnet = false, $ifconfig_details foreach ($result as &$info) { foreach (config_read_array('virtualip', 'vip') as $vip) { - if (empty($info['interface']) || $info['interface'] != $vip['interface'] || $vip['mode'] != 'ipalias') { + if (empty($info['interface']) || $info['interface'] != $vip['interface']) { + continue; + } + + if ($vip['mode'] != 'ipalias' && $vip['mode'] != 'carp') { continue; } diff --git a/src/www/firewall_virtual_ip_edit.php b/src/www/firewall_virtual_ip_edit.php index bafb7bb53..573116aaa 100644 --- a/src/www/firewall_virtual_ip_edit.php +++ b/src/www/firewall_virtual_ip_edit.php @@ -1,7 +1,7 @@ * Copyright (C) 2003-2005 Manuel Kasper * Copyright (C) 2004-2005 Scott Ullrich @@ -93,7 +93,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { } } } elseif ($_SERVER['REQUEST_METHOD'] === 'POST') { - $input_errors = array(); + $input_errors = []; $pconfig = $_POST; // input record id, if valid @@ -103,11 +103,11 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { if (!empty($config['interfaces'][$pconfig['interface']]) && !empty($config['interfaces'][$pconfig['interface']]['if'])) { $selected_interface = $config['interfaces'][$pconfig['interface']]['if']; } else { - $selected_interface = array(); + $selected_interface = []; } // perform form validations - $reqdfields = array("mode"); - $reqdfieldsn = array(gettext("Type")); + $reqdfields = ['mode']; + $reqdfieldsn = [gettext('Type')]; do_input_validation($pconfig, $reqdfields, $reqdfieldsn, $input_errors); if (isset($id) && $pconfig['mode'] != $a_vip[$id]['mode']) { @@ -193,7 +193,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { $vipent['noexpand'] = true; } if (empty($pconfig['bind'])) { - // nobind, only used for alias or carp + // nobind, only used for ipalias/carp $vipent['nobind'] = true; } @@ -204,14 +204,14 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { if (file_exists('/tmp/.firewall_virtual_ip.apply')) { $toapplylist = unserialize(file_get_contents('/tmp/.firewall_virtual_ip.apply')); } else { - $toapplylist = array(); + $toapplylist = []; } if (isset($id)) { // save existing content before changing it $toapplylist[$id] = $a_vip[$id]; } else { // new entry, no old data - $toapplylist[count($a_vip)] = array(); + $toapplylist[count($a_vip)] = []; } if (isset($id)) { @@ -357,8 +357,8 @@ $( document ).ready(function() {