mirror of
https://github.com/pfsense/pfsense.git
synced 2025-10-26 11:38:35 +00:00
Ticket #543. Do not allow to change an interface already configured to a type none if it is referenced by VIPs and also do not allow VIPs to be configured on an interface with type none. Maybe the latest should be relaxed to only disallow this for ipaliases?!
This commit is contained in:
parent
9dea60d146
commit
62a4abc92c
@ -109,9 +109,12 @@ if ($_POST) {
|
||||
$input_errors[] = gettext("A valid IP address must be specified.");
|
||||
|
||||
$natiflist = get_configured_interface_with_descr();
|
||||
foreach ($natiflist as $natif => $natdescr)
|
||||
foreach ($natiflist as $natif => $natdescr) {
|
||||
if (empty($config['interfaces'][$natif]['ipaddr']))
|
||||
$input_errors[] = gettext("The interface choosen for the VIP has no ip configured so it cannot be used as a parent for the VIP.");
|
||||
if ($_POST['subnet'] == get_interface_ip($natif))
|
||||
$input_errors[] = sprintf(gettext("The %s IP address may not be used in a virtual entry."),$natdescr);
|
||||
}
|
||||
|
||||
if($_POST['subnet_bits'] == "32" and $_POST['type'] == "carp")
|
||||
$input_errors[] = gettext("The /32 subnet mask is invalid for CARP IPs.");
|
||||
|
||||
@ -375,9 +375,15 @@ if ($_POST) {
|
||||
$reqdfieldsn = array(gettext("IP address"),gettext("Subnet bit count"),gettext("Gateway"));
|
||||
do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors);
|
||||
case "none":
|
||||
if(is_array($config['virtualip']['vip'])) {
|
||||
foreach ($config['virtualip']['vip'] as $vip) {
|
||||
if ($vip['interface'] == $if)
|
||||
$input_errors[] = gettext("This interface is referenced by VIPs please delete those before setting the interface to 'none' configuration.");
|
||||
}
|
||||
}
|
||||
case "dhcp":
|
||||
if (in_array($wancfg['ipaddr'], array("ppp", "pppoe", "pptp", "l2tp")))
|
||||
$input_errors[] = "You have to reassign the interface to be able to configure as {$_POST['type']}.";
|
||||
$input_errors[] = gettext("You have to reassign the interface to be able to configure as {$_POST['type']}.");
|
||||
break;
|
||||
case "ppp":
|
||||
$reqdfields = explode(" ", "port phone");
|
||||
|
||||
Loading…
Reference in New Issue
Block a user