diff options
author | jim-p <jimp@pfsense.org> | 2010-10-21 17:08:58 -0400 |
---|---|---|
committer | jim-p <jimp@pfsense.org> | 2010-10-21 17:08:58 -0400 |
commit | 630d7025810bf1ce006490db8524d6edc37ee6fb (patch) | |
tree | f3762d2542df996f9b9f950f2f9eabdc740518ad /usr/local/www/services_dhcp.php | |
parent | ab8d138dcd5114c4892e12c514990797572fd318 (diff) | |
download | pfsense-630d7025810bf1ce006490db8524d6edc37ee6fb.zip pfsense-630d7025810bf1ce006490db8524d6edc37ee6fb.tar.gz |
Prevent the DHCP range from being changed to include static mapping entries. Fixes #964.
Diffstat (limited to 'usr/local/www/services_dhcp.php')
-rwxr-xr-x | usr/local/www/services_dhcp.php | 11 |
1 files changed, 11 insertions, 0 deletions
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.")); + } + } } } |