summaryrefslogtreecommitdiffstats
path: root/usr/local/www/services_dhcp_edit.php
diff options
context:
space:
mode:
authorjim-p <jimp@pfsense.org>2010-10-21 16:58:40 -0400
committerjim-p <jimp@pfsense.org>2010-10-21 16:58:40 -0400
commitab8d138dcd5114c4892e12c514990797572fd318 (patch)
treeae379234035d9cc9718ba617cd8e0b523e8c5127 /usr/local/www/services_dhcp_edit.php
parent62b262e4766bcd5e46b4191e0f618087b78d8f40 (diff)
downloadpfsense-ab8d138dcd5114c4892e12c514990797572fd318.zip
pfsense-ab8d138dcd5114c4892e12c514990797572fd318.tar.gz
Reject DHCP static mappings that are inside of the DHCP range. Fixes #966
Diffstat (limited to 'usr/local/www/services_dhcp_edit.php')
-rwxr-xr-xusr/local/www/services_dhcp_edit.php5
1 files changed, 5 insertions, 0 deletions
diff --git a/usr/local/www/services_dhcp_edit.php b/usr/local/www/services_dhcp_edit.php
index cccbd2a..525a983 100755
--- a/usr/local/www/services_dhcp_edit.php
+++ b/usr/local/www/services_dhcp_edit.php
@@ -150,6 +150,11 @@ if ($_POST) {
if ($_POST['ipaddr']) {
$dynsubnet_start = ip2ulong($config['dhcpd'][$if]['range']['from']);
$dynsubnet_end = ip2ulong($config['dhcpd'][$if]['range']['to']);
+ if ((ip2ulong($_POST['ipaddr']) > $dynsubnet_start) &&
+ (ip2ulong($_POST['ipaddr']) < $dynsubnet_end)) {
+ $input_errors[] = sprintf(gettext("The IP address must not be within the DHCP range for this interface."));
+ }
+
$lansubnet_start = ip2ulong(long2ip32(ip2long($ifcfgip) & gen_subnet_mask_long($ifcfgsn)));
$lansubnet_end = ip2ulong(long2ip32(ip2long($ifcfgip) | (~gen_subnet_mask_long($ifcfgsn))));
if ((ip2ulong($_POST['ipaddr']) < $lansubnet_start) ||
OpenPOWER on IntegriCloud