Fix the IP address check to allow for interfaces that just have a IPv6 address but no IPv4

This commit is contained in:
Seth Mos 2011-02-10 11:18:28 +01:00
parent 652ed95d3d
commit 6715c2a295

View File

@ -112,8 +112,8 @@ if ($_POST) {
$natiflist = get_configured_interface_with_descr();
foreach ($natiflist as $natif => $natdescr) {
if ($_POST['interface'] == $natif && empty($config['interfaces'][$natif]['ipaddr']))
$input_errors[] = gettext("The interface chosen for the VIP has no ip configured so it cannot be used as a parent for the VIP.");
if ($_POST['interface'] == $natif && (empty($config['interfaces'][$natif]['ipaddr']) && empty($config['interfaces'][$natif]['ipaddrv6'])))
$input_errors[] = gettext("The interface chosen for the VIP has no IPv4 or IPv6 address 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);
}