diff options
author | jim-p <jimp@pfsense.org> | 2010-10-21 16:58:40 -0400 |
---|---|---|
committer | jim-p <jimp@pfsense.org> | 2010-10-21 16:58:40 -0400 |
commit | ab8d138dcd5114c4892e12c514990797572fd318 (patch) | |
tree | ae379234035d9cc9718ba617cd8e0b523e8c5127 /usr/local | |
parent | 62b262e4766bcd5e46b4191e0f618087b78d8f40 (diff) | |
download | pfsense-ab8d138dcd5114c4892e12c514990797572fd318.zip pfsense-ab8d138dcd5114c4892e12c514990797572fd318.tar.gz |
Reject DHCP static mappings that are inside of the DHCP range. Fixes #966
Diffstat (limited to 'usr/local')
-rwxr-xr-x | usr/local/www/services_dhcp_edit.php | 5 |
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) || |