summaryrefslogtreecommitdiffstats
path: root/src/usr/local/bin
diff options
context:
space:
mode:
authorheper <heper@users.noreply.github.com>2015-11-09 16:01:08 +0100
committerheper <heper@users.noreply.github.com>2015-11-09 16:01:08 +0100
commit588a6068e476c2867948735ece7a5e8c886abd5a (patch)
tree25674fe89f17a2f4e0943b2591e7a4ddf4720d14 /src/usr/local/bin
parentbe189fe12f1c319d796d804e9e104b2a2bd2b797 (diff)
downloadpfsense-588a6068e476c2867948735ece7a5e8c886abd5a.zip
pfsense-588a6068e476c2867948735ece7a5e8c886abd5a.tar.gz
improve validation $argv[1]
Diffstat (limited to 'src/usr/local/bin')
-rw-r--r--src/usr/local/bin/dhcpd_gather_stats.php10
1 files changed, 1 insertions, 9 deletions
diff --git a/src/usr/local/bin/dhcpd_gather_stats.php b/src/usr/local/bin/dhcpd_gather_stats.php
index f76f9d9..128fe0f 100644
--- a/src/usr/local/bin/dhcpd_gather_stats.php
+++ b/src/usr/local/bin/dhcpd_gather_stats.php
@@ -31,15 +31,12 @@ echo "N:";
$result = "NaN";
$result_static="NaN";
-if (isset($argv[1])) {
+if (is_array($config['dhcpd'][$argv[1]])) {
$leasesfile = "{$g['dhcpd_chroot_path']}/var/db/dhcpd.leases";
$leases_contents = file($leasesfile);
$dhcpif = $argv[1] ;
-
-
-
function remove_duplicate($array, $field) {
foreach ($array as $sub) {
$cmp[] = $sub[$field];
@@ -199,17 +196,12 @@ if (isset($argv[1])) {
if ($data['act'] != "static") {
if (($lip >= ip2ulong($config['dhcpd'][$dhcpif]['range']['from'])) && ($lip <= ip2ulong($config['dhcpd'][$dhcpif]['range']['to']))) {
$result = $result + 1;
-
}
}
else {
-
-
if (($lip >= $subnet_start) && ($lip <= $subnet_end)) {
$result_static = $result_static + 1;
}
-
-
}
}
}
OpenPOWER on IntegriCloud