From b5ce1a53767bc7067364defef2788050327edfb6 Mon Sep 17 00:00:00 2001 From: Anders Lind Date: Tue, 1 Mar 2016 19:55:29 +0100 Subject: Fix indexing of $mappings and fix column headers Remove "$entry['iaid'] . " from $mappings[] since the IAID of the IA_NA != IAID of the IA_PD, please see note in https://redmine.pfsense.org/issues/4206#note-9 Add table header for the icon in the Delegated Prefixes section to fix alignment of the column headers. --- src/usr/local/www/status_dhcpv6_leases.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/usr/local') diff --git a/src/usr/local/www/status_dhcpv6_leases.php b/src/usr/local/www/status_dhcpv6_leases.php index 87c1ad4..8bb01b6 100644 --- a/src/usr/local/www/status_dhcpv6_leases.php +++ b/src/usr/local/www/status_dhcpv6_leases.php @@ -357,7 +357,7 @@ while ($i < $leases_count) { $prefixes[] = $entry; } else { $leases[] = $entry; - $mappings[$entry['iaid'] . $entry['duid']] = $entry['ip']; + $mappings[$entry['duid']] = $entry['ip']; } $l++; $i++; @@ -543,6 +543,7 @@ foreach ($leases as $data): + @@ -593,7 +594,7 @@ foreach ($prefixes as $data): -- cgit v1.1 From e3e21e7094fef849419ab68f4699e12dc9bc00a4 Mon Sep 17 00:00:00 2001 From: Anders Lind Date: Wed, 2 Mar 2016 22:32:41 +0100 Subject: Update status_dhcpv6_leases.php Fix lacking of incrementation of index when two characters have been passed. Fix check of $n so that the octal value is checked as an octal value. --- src/usr/local/www/status_dhcpv6_leases.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/usr/local') diff --git a/src/usr/local/www/status_dhcpv6_leases.php b/src/usr/local/www/status_dhcpv6_leases.php index 40e50e5..9b7f37e 100644 --- a/src/usr/local/www/status_dhcpv6_leases.php +++ b/src/usr/local/www/status_dhcpv6_leases.php @@ -162,9 +162,13 @@ function parse_duid($duid_string) { $n = substr($duid_string, $i+1, 1); if (($n == '\\') || ($n == '"')) { $parsed_duid[] = sprintf("%02x", ord($n)); - } elseif (is_numeric($n)) { - $parsed_duid[] = sprintf("%02x", octdec(substr($duid_string, $i+1, 3))); - $i += 3; + $i += 1; + } else { + $n = substr($duid_string, $i+1, 3); + if (preg_match('/[0-3][0-7]{2}/', $n)) { + $parsed_duid[] = sprintf("%02x", octdec($n)); + $i += 3; + } } } else { $parsed_duid[] = sprintf("%02x", ord($s)); -- cgit v1.1
- +
: -- cgit v1.1 From 0ce280674e4afecbb2f33b373cef453973bb0007 Mon Sep 17 00:00:00 2001 From: Anders Lind Date: Tue, 1 Mar 2016 20:06:06 +0100 Subject: Missed to fix all $mappings --- src/usr/local/www/status_dhcpv6_leases.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/usr/local') diff --git a/src/usr/local/www/status_dhcpv6_leases.php b/src/usr/local/www/status_dhcpv6_leases.php index 8bb01b6..40e50e5 100644 --- a/src/usr/local/www/status_dhcpv6_leases.php +++ b/src/usr/local/www/status_dhcpv6_leases.php @@ -596,7 +596,7 @@ foreach ($prefixes as $data):
- : + :