From b2605914777a8026910bf8ce8b324fce61803ad2 Mon Sep 17 00:00:00 2001 From: jim-p Date: Tue, 6 Feb 2018 11:37:31 -0500 Subject: [PATCH] Do not apply a DHCP static mapping uniqueness test for hostnames or IP addresses. The DHCP daemon allows the entries to be duplicated provided they have unique MAC addresses or identifiers. Fixes #8220 --- src/usr/local/www/services_dhcp_edit.php | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/src/usr/local/www/services_dhcp_edit.php b/src/usr/local/www/services_dhcp_edit.php index 2caba1e2672..1423171e45f 100644 --- a/src/usr/local/www/services_dhcp_edit.php +++ b/src/usr/local/www/services_dhcp_edit.php @@ -185,16 +185,9 @@ function staticmaps_sort($ifgui) { if (isset($id) && ($a_maps[$id]) && ($a_maps[$id] === $mapent)) { continue; } - /* The fully qualified hostname (hostname + '.' + domainname) must be unique. - * The unqualified hostname does not have to be unique as long as the fully - * qualified hostname is unique. */ - $existingFqn = "{$mapent['hostname']}.{$mapent['domain']}"; - $candidateFqn = "{$_POST['hostname']}.{$_POST['domain']}"; - if ((($existingFqn == $candidateFqn) && $mapent['hostname']) || - (($mapent['mac'] == $_POST['mac']) && $mapent['mac']) || - (($mapent['ipaddr'] == $_POST['ipaddr']) && $mapent['ipaddr']) || + if ((($mapent['mac'] == $_POST['mac']) && $mapent['mac']) || (($mapent['cid'] == $_POST['cid']) && $mapent['cid'])) { - $input_errors[] = gettext("This fully qualified hostname (Hostname + Domainname), IP, MAC address or Client identifier already exists."); + $input_errors[] = gettext("This MAC address or Client identifier already exists."); break; } } @@ -439,7 +432,8 @@ function staticmaps_sort($ifgui) { $pconfig['ipaddr'], 'V4' ))->setHelp('If an IPv4 address is entered, the address must be outside of the pool.%1$s' . - 'If no IPv4 address is given, one will be dynamically allocated from the pool.', '
'); + 'If no IPv4 address is given, one will be dynamically allocated from the pool.%1$s%1$s' . + 'The same IP address may be assigned to multiple mappings.', '
'); $section->addInput(new Form_Input( 'hostname',