Project

General

Profile

« Previous | Next » 

Revision 62a4abc9

Added by Ermal LUÇI almost 15 years ago

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?!

View differences:

usr/local/www/firewall_virtual_ip_edit.php
109 109
		$input_errors[] = gettext("A valid IP address must be specified.");
110 110

  
111 111
	$natiflist = get_configured_interface_with_descr();
112
	foreach ($natiflist as $natif => $natdescr)
112
	foreach ($natiflist as $natif => $natdescr) {
113
		if (empty($config['interfaces'][$natif]['ipaddr']))
114
			$input_errors[] = gettext("The interface choosen for the VIP has no ip configured so it cannot be used as a parent for the VIP.");
113 115
		if ($_POST['subnet'] == get_interface_ip($natif))
114 116
			$input_errors[] = sprintf(gettext("The %s IP address may not be used in a virtual entry."),$natdescr);
117
	}
115 118

  
116 119
	if($_POST['subnet_bits'] == "32" and $_POST['type'] == "carp")
117 120
	 	$input_errors[] = gettext("The /32 subnet mask is invalid for CARP IPs.");
usr/local/www/interfaces.php
375 375
			$reqdfieldsn = array(gettext("IP address"),gettext("Subnet bit count"),gettext("Gateway"));
376 376
			do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors);
377 377
		case "none":
378
			if(is_array($config['virtualip']['vip'])) {
379
				foreach ($config['virtualip']['vip'] as $vip) {
380
					if ($vip['interface'] == $if)
381
						$input_errors[] = gettext("This interface is referenced by VIPs please delete those before setting the interface to 'none' configuration.");
382
				}
383
			}
378 384
		case "dhcp":
379 385
			if (in_array($wancfg['ipaddr'], array("ppp", "pppoe", "pptp", "l2tp")))
380
				$input_errors[] = "You have to reassign the interface to be able to configure as {$_POST['type']}.";
386
				$input_errors[] = gettext("You have to reassign the interface to be able to configure as {$_POST['type']}.");
381 387
			break;
382 388
		case "ppp":
383 389
			$reqdfields = explode(" ", "port phone");

Also available in: Unified diff