summaryrefslogtreecommitdiffstats
path: root/usr/local/www/services_dhcp.php
diff options
context:
space:
mode:
authorBill Marquette <billm@pfsense.org>2005-08-22 04:19:54 +0000
committerBill Marquette <billm@pfsense.org>2005-08-22 04:19:54 +0000
commit4f3c4086f19f47534c9eda8bf68e4e2a9ac9e533 (patch)
tree091f9f89a122a93296e45295b7b8b5b123d51186 /usr/local/www/services_dhcp.php
parent1a82cbcb44300b57821bb07fffeca4ac91dfd795 (diff)
downloadpfsense-4f3c4086f19f47534c9eda8bf68e4e2a9ac9e533.zip
pfsense-4f3c4086f19f47534c9eda8bf68e4e2a9ac9e533.tar.gz
use ip2long() to check ip addresses
Diffstat (limited to 'usr/local/www/services_dhcp.php')
-rwxr-xr-xusr/local/www/services_dhcp.php9
1 files changed, 3 insertions, 6 deletions
diff --git a/usr/local/www/services_dhcp.php b/usr/local/www/services_dhcp.php
index 32c44c1..92a7b5e 100755
--- a/usr/local/www/services_dhcp.php
+++ b/usr/local/www/services_dhcp.php
@@ -69,12 +69,9 @@ staticmaps_sort($if);
$a_maps = &$config['dhcpd'][$if]['staticmap'];
function is_inrange($test, $start, $end) {
- $tmp = explode(".", $test);
- $o_test = $tmp[3];
- $tmp = explode(".", $start);
- $o_start = $tmp[3];
- $tmp = explode(".", $end);
- $o_end = $tmp[3];
+ $o_test = sprintf("%u", ip2long($test));
+ $o_start = sprintf("%u", ip2long($start));
+ $o_end = sprintf("%u", ip2long($end));
if ( ($o_test < $o_end) && ($o_test > $o_start) )
return true;
OpenPOWER on IntegriCloud