summaryrefslogtreecommitdiffstats
path: root/usr/local/www
diff options
context:
space:
mode:
authorRenato Botelho <garga@pfSense.org>2014-03-11 09:53:48 -0300
committerRenato Botelho <garga@pfSense.org>2014-03-11 09:53:48 -0300
commitce99dba2e692f88b5e7665fdb0750126d3080985 (patch)
treef286952982ff48f13ee03ee3a3a05947148c90e8 /usr/local/www
parentac28b62eb8bad7142ba0f9925ff4936da53c88fd (diff)
parenta9fc108f9c09c2b2ea0afb3fca5d526cbaea9bb7 (diff)
downloadpfsense-ce99dba2e692f88b5e7665fdb0750126d3080985.zip
pfsense-ce99dba2e692f88b5e7665fdb0750126d3080985.tar.gz
Merge pull request #1010 from PiBa-NL/alias_allow_delete
firewall_virtual_ip , allow deleting last ip-alias if interface uses same the subnet. (while CARP-ip is present)
Diffstat (limited to 'usr/local/www')
-rwxr-xr-xusr/local/www/firewall_virtual_ip.php9
1 files changed, 7 insertions, 2 deletions
diff --git a/usr/local/www/firewall_virtual_ip.php b/usr/local/www/firewall_virtual_ip.php
index 8e524a6..b081c46 100755
--- a/usr/local/www/firewall_virtual_ip.php
+++ b/usr/local/www/firewall_virtual_ip.php
@@ -140,22 +140,27 @@ if ($_GET['act'] == "del") {
}
if ($a_vip[$_GET['id']]['mode'] == "ipalias") {
+ $subnet = gen_subnet($a_vip[$_GET['id']]['subnet'], $a_vip[$_GET['id']]['subnet_bits']) . "/" . $a_vip[$_GET['id']]['subnet_bits'];
+ $found_if = false;
$found_carp = false;
$found_other_alias = false;
+ if ($subnet == $if_subnet)
+ $found_if = true;
+
$vipiface = $a_vip[$_GET['id']]['interface'];
foreach ($a_vip as $vip_id => $vip) {
if ($vip_id == $_GET['id'])
continue;
- if ($vip['interface'] == $vipiface && ip_in_subnet($vip['subnet'], gen_subnet($a_vip[$_GET['id']]['subnet'], $a_vip[$_GET['id']]['subnet_bits']) . "/" . $a_vip[$_GET['id']]['subnet_bits']))
+ if ($vip['interface'] == $vipiface && ip_in_subnet($vip['subnet'], $subnet))
if ($vip['mode'] == "carp")
$found_carp = true;
else if ($vip['mode'] == "ipalias")
$found_other_alias = true;
}
- if ($found_carp === true && $found_other_alias === false)
+ if ($found_carp === true && $found_other_alias === false && $found_if === false)
$input_errors[] = gettext("This entry cannot be deleted because it is still referenced by a CARP IP with the description") . " {$vip['descr']}.";
}
OpenPOWER on IntegriCloud