Do not allow proxy arp to be edited if it references a carp.

This commit is contained in:
Ermal 2010-08-26 16:47:10 +00:00
parent e19b7d1ea8
commit a3733a0c35

View File

@ -154,8 +154,22 @@ if ($_POST) {
}
if (isset($id) && ($a_vip[$id])) {
if ($a_vip[$id]['mode'] != $_POST['mode'])
interface_vip_bring_down($a_vip[$id]);
if ($a_vip[$id]['mode'] != $_POST['mode']) {
$bringdown = false;
if ($a_vip[$id]['mode'] == "proxyarp") {
$vipiface = $a_vip[$id]['interface'];
foreach ($a_vip as $vip) {
if ($vip['interface'] == $vipiface && $vip['mode'] == "carp") {
if (ip_in_subnet($vip['subnet'], gen_subnet($a_vip[$id]['subnet'], $a_vip[$id]['subnet_bits']) . "/" . $a_vip[$id]['subnet_bits'])) {
$input_errors[] = gettext("This entry cannot be modified because it is still referenced by CARP") . " {$vip['descr']}.";
$bringdown = false;
}
}
}
}
if (bringdown == false)
interface_vip_bring_down($a_vip[$id]);
}
if ($a_vip[$id]['interface'] != $_POST['interface'])
interface_vip_bring_down($a_vip[$id]);
}