@@ -6,10 +6,7 @@
__network_ifstatus() {
local __tmp
- [ -z "$__NETWORK_CACHE" ] && \
- export __NETWORK_CACHE="$(ubus call network.interface dump)"
-
- __tmp="$(jsonfilter ${4:+-F "$4"} ${5:+-l "$5"} -s "$__NETWORK_CACHE" -e "$1=@.interface${2:+[@.interface='$2']}$3")"
+ __tmp="$(ubus call network.interface dump | jsonfilter ${4:+-F "$4"} ${5:+-l "$5"} -e "$1=@.interface${2:+[@.interface='$2']}$3")"
[ -z "$__tmp" ] && \
unset "$1" && \
@@ -265,4 +262,4 @@ network_ready_device()
}
# flush the internal value cache to force re-reading values from ubus
-network_flush_cache() { unset __NETWORK_CACHE; }
+network_flush_cache() { true; }
Having hundrets of interfaces configured with netifd makes __network_ifstatus go busted with "jsonfilter: Argument list too long". Fix this by removing the __NETWORK_CACHE environment variable. The network_flush_cache function is kept so it can be reused later for per-interface caching or similar things. Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com> --- FYI I've tried using a temp-file as cache but no real speed-up could be observed. Hence, it might make sense to look into per-interface caching instead. package/base-files/files/lib/functions/network.sh | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-)