From 630d7025810bf1ce006490db8524d6edc37ee6fb Mon Sep 17 00:00:00 2001 From: jim-p Date: Thu, 21 Oct 2010 17:08:58 -0400 Subject: Prevent the DHCP range from being changed to include static mapping entries. Fixes #964. --- usr/local/www/services_dhcp.php | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'usr/local/www/services_dhcp.php') diff --git a/usr/local/www/services_dhcp.php b/usr/local/www/services_dhcp.php index e2ce65b..a144043 100755 --- a/usr/local/www/services_dhcp.php +++ b/usr/local/www/services_dhcp.php @@ -276,6 +276,17 @@ if ($_POST) { /* make sure that the DHCP Relay isn't enabled on this interface */ if (isset($config['dhcrelay'][$if]['enable'])) $input_errors[] = sprintf(gettext("You must disable the DHCP relay on the %s interface before enabling the DHCP server."),$iflist[$if]); + + $dynsubnet_start = ip2ulong($_POST['range_from']); + $dynsubnet_end = ip2ulong($_POST['range_to']); + foreach ($a_maps as $map) { + if (empty($map['ipaddr'])) + continue; + if ((ip2ulong($map['ipaddr']) > $dynsubnet_start) && + (ip2ulong($map['ipaddr']) < $dynsubnet_end)) { + $input_errors[] = sprintf(gettext("The DHCP range cannot overlap any static DHCP mappings.")); + } + } } } -- cgit v1.1