From 197e70dbfa45286f66c006f428b2e5d832aa4d2b Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Fri, 12 Jul 2019 11:03:06 +0200 Subject: [PATCH] interfaces, performance. support passing the output of our ifconfig parser for https://github.com/opnsense/core/issues/3567 so we can prevent additional requests on non changing data --- src/etc/inc/interfaces.inc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/etc/inc/interfaces.inc b/src/etc/inc/interfaces.inc index f844ab00e..70a6f861b 100644 --- a/src/etc/inc/interfaces.inc +++ b/src/etc/inc/interfaces.inc @@ -4495,7 +4495,7 @@ function make_ipv6_64_address($prefix, $suffix) return implode(':', $prefix_array); } -function interfaces_addresses($interfaces, $as_subnet = false) +function interfaces_addresses($interfaces, $as_subnet = false, $ifconfig_details = null) { global $config; @@ -4523,7 +4523,11 @@ function interfaces_addresses($interfaces, $as_subnet = false) $realifs = array_unique($realifs); - $intf_details = count($realifs) > 1 ? legacy_interfaces_details() : legacy_interfaces_details($realifs[0]); + if (!empty($ifconfig_details)) { + $intf_details = $ifconfig_details; + } else { + $intf_details = count($realifs) > 1 ? legacy_interfaces_details() : legacy_interfaces_details($realifs[0]); + } foreach ($realifs as $realif) { foreach (array('ipv4', 'ipv6') as $proto) {