summaryrefslogtreecommitdiffstats
path: root/usr/local/www/status_dhcpv6_leases.php
diff options
context:
space:
mode:
authorjim-p <jimp@pfsense.org>2011-06-19 12:39:11 -0400
committerjim-p <jimp@pfsense.org>2011-06-19 12:39:11 -0400
commitffdcbeb67b3b8bea0e381e9d969fb4743eff7754 (patch)
tree10dfb78c6de90904a52f2d63b12eae124571b91d /usr/local/www/status_dhcpv6_leases.php
parent248501cd9d4d4370a95ec1f6f679afa3c26bea52 (diff)
downloadpfsense-ffdcbeb67b3b8bea0e381e9d969fb4743eff7754.zip
pfsense-ffdcbeb67b3b8bea0e381e9d969fb4743eff7754.tar.gz
Also ignore lines starting with server-duid, and fix the # ignore so it is anchored on the start of the line. Add a note to fix a loop later that can fall into infinity.
Diffstat (limited to 'usr/local/www/status_dhcpv6_leases.php')
-rw-r--r--usr/local/www/status_dhcpv6_leases.php4
1 files changed, 3 insertions, 1 deletions
diff --git a/usr/local/www/status_dhcpv6_leases.php b/usr/local/www/status_dhcpv6_leases.php
index 7ca05f8..0f79666 100644
--- a/usr/local/www/status_dhcpv6_leases.php
+++ b/usr/local/www/status_dhcpv6_leases.php
@@ -110,8 +110,9 @@ function remove_duplicate($array, $field)
}
$awk = "/usr/bin/awk";
+
/* this pattern sticks comments into a single array item */
-$cleanpattern = "'{ gsub(\"#.*\", \"\");} { gsub(\";\", \"\"); print;}'";
+$cleanpattern = "'{ gsub(\"^#.*\", \"\");} { gsub(\"^server-duid.*\", \"\");} { gsub(\";\", \"\"); print;}'";
/* We then split the leases file by } */
$splitpattern = "'BEGIN { RS=\"}\";} {for (i=1; i<=NF; i++) printf \"%s \", \$i; printf \"}\\n\";}'";
@@ -165,6 +166,7 @@ while($i < $leases_count) {
case "ia-na":
if ($data[$f+1][0] == '"') {
$duid = "";
+ /* FIXME: This needs a safety belt to prevent an infinite loop */
while ($data[$f][strlen($data[$f])-1] != '"') {
$duid .= " " . $data[$f+1];
$f++;
OpenPOWER on IntegriCloud