From 4e85523b254c41291c0df19d0818c2320fcc6a8b Mon Sep 17 00:00:00 2001 From: jim-p Date: Wed, 21 Sep 2011 16:14:17 -0400 Subject: Speed up display of static dhcpv6 leases by skipping an additional ndp exec for each entry, use the existing arpdata array instead. --- usr/local/www/status_dhcpv6_leases.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr/local/www/status_dhcpv6_leases.php b/usr/local/www/status_dhcpv6_leases.php index 60d8a91..0b644ee 100644 --- a/usr/local/www/status_dhcpv6_leases.php +++ b/usr/local/www/status_dhcpv6_leases.php @@ -305,12 +305,12 @@ foreach($config['interfaces'] as $ifname => $ifarr) { $slease['end'] = ""; $slease['hostname'] = htmlentities($static['hostname']); $slease['act'] = "static"; - $online = exec("/usr/sbin/ndp -an |/usr/bin/grep {$slease['ip']}| /usr/bin/wc -l|/usr/bin/awk '{print $1;}'"); - if ($online == 1) { + if (in_array($slease['ip'], array_keys($arpdata))) { $slease['online'] = 'online'; } else { $slease['online'] = 'offline'; } + $leases[] = $slease; } } -- cgit v1.1