summaryrefslogtreecommitdiffstats
path: root/src/usr/local/www/services_dhcp_edit.php
diff options
context:
space:
mode:
authorRenato Botelho <renato@netgate.com>2016-02-24 09:53:42 -0300
committerRenato Botelho <renato@netgate.com>2016-02-24 11:01:49 -0300
commit4b6c15cd8dbccdb44330fd152a7481da3e7980fc (patch)
tree0ef698d1226cb0f668f6576614c545a47a4e73eb /src/usr/local/www/services_dhcp_edit.php
parent30c8a2902a70e2dba7fcd6292f0c523fbb9b71d1 (diff)
downloadpfsense-4b6c15cd8dbccdb44330fd152a7481da3e7980fc.zip
pfsense-4b6c15cd8dbccdb44330fd152a7481da3e7980fc.tar.gz
Use high level functions
Diffstat (limited to 'src/usr/local/www/services_dhcp_edit.php')
-rw-r--r--src/usr/local/www/services_dhcp_edit.php12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/usr/local/www/services_dhcp_edit.php b/src/usr/local/www/services_dhcp_edit.php
index 996a1ee..ae743ef 100644
--- a/src/usr/local/www/services_dhcp_edit.php
+++ b/src/usr/local/www/services_dhcp_edit.php
@@ -249,19 +249,17 @@ if ($_POST) {
}
}
- $lansubnet_start = ip2ulong(gen_subnetv4($ifcfgip, $ifcfgsn));
- $lansubnet_end = ip2ulong(gen_subnetv4_max($ifcfgip, $ifcfgsn));
- $ipaddr_int = ip2ulong($_POST['ipaddr']);
- if (($ipaddr_int < $lansubnet_start) ||
- ($ipaddr_int > $lansubnet_end)) {
+ $lansubnet_start = gen_subnetv4($ifcfgip, $ifcfgsn);
+ $lansubnet_end = gen_subnetv4_max($ifcfgip, $ifcfgsn);
+ if (!is_inrange_v4($_POST['ipaddr'], $lansubnet_start, $lansubnet_end)) {
$input_errors[] = sprintf(gettext("The IP address must lie in the %s subnet."), $ifcfgdescr);
}
- if ($ipaddr_int == $lansubnet_start) {
+ if ($_POST['ipaddr'] == $lansubnet_start) {
$input_errors[] = sprintf(gettext("The IP address cannot be the %s network address."), $ifcfgdescr);
}
- if ($ipaddr_int == $lansubnet_end) {
+ if ($_POST['ipaddr'] == $lansubnet_end) {
$input_errors[] = sprintf(gettext("The IP address cannot be the %s broadcast address."), $ifcfgdescr);
}
}
OpenPOWER on IntegriCloud