diff options
author | Anders Lind <anders.lind@gmail.com> | 2016-03-02 23:42:49 +0100 |
---|---|---|
committer | Anders Lind <anders.lind@gmail.com> | 2016-03-02 23:42:49 +0100 |
commit | fc6194181ef4d99db32e35f8190cfe45edc4503c (patch) | |
tree | e0e3a01c16d27bd12646f7eb9be986396b5c4fea /src/usr/local | |
parent | ba045ef1463e47d432a68a1d1ae8c35075d84156 (diff) | |
parent | e3e21e7094fef849419ab68f4699e12dc9bc00a4 (diff) | |
download | pfsense-fc6194181ef4d99db32e35f8190cfe45edc4503c.zip pfsense-fc6194181ef4d99db32e35f8190cfe45edc4503c.tar.gz |
Merge pull request #1 from al-right/al-right-patch-1
Al right patch 1
Diffstat (limited to 'src/usr/local')
-rw-r--r-- | src/usr/local/www/status_dhcpv6_leases.php | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/src/usr/local/www/status_dhcpv6_leases.php b/src/usr/local/www/status_dhcpv6_leases.php index 87c1ad4..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)); @@ -357,7 +361,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 +547,7 @@ foreach ($leases as $data): <table class="table table-striped table-hover table-condensed sortable-theme-bootstrap" data-sortable> <thead> <tr> + <th><!-- icon --></th> <th><?=gettext("IPv6 Prefix")?></th> <th><?=gettext("IAID")?></th> <th><?=gettext("DUID")?></th> @@ -593,9 +598,9 @@ foreach ($prefixes as $data): <td><i class="fa <?=$icon?>"></i></td> <td> <?=$data['prefix']?> -<?php if ($mappings[$data['iaid'] . $data['duid']]): ?> +<?php if ($mappings[$data['duid']]): ?> <br /> - <?=gettext('Routed To')?>: <?=$mappings[$data['iaid'] . $data['duid']]?> + <?=gettext('Routed To')?>: <?=$mappings[$data['duid']]?> <?php endif; ?> </td> <td><?=$data['iaid']?></td> |