Project

General

Profile

« Previous | Next » 

Revision 4e85523b

Added by Jim Pingle almost 14 years ago

Speed up display of static dhcpv6 leases by skipping an additional ndp exec for each entry, use the existing arpdata array instead.

View differences:

usr/local/www/status_dhcpv6_leases.php
305 305
			$slease['end'] = "";
306 306
			$slease['hostname'] = htmlentities($static['hostname']);
307 307
			$slease['act'] = "static";
308
			$online = exec("/usr/sbin/ndp -an |/usr/bin/grep {$slease['ip']}| /usr/bin/wc -l|/usr/bin/awk '{print $1;}'");
309
			if ($online == 1) {
308
			if (in_array($slease['ip'], array_keys($arpdata))) {
310 309
				$slease['online'] = 'online';
311 310
			} else {
312 311
				$slease['online'] = 'offline';
313 312
			}
313

  
314 314
			$leases[] = $slease;
315 315
		}
316 316
	}

Also available in: Unified diff