openwrtv4/package/base-files/files
Jo-Philipp Wich 1bad852ff5 base-files: network.sh: gracefully handle missing network.interface ubus ns
When attempting to use any of the functions in network.sh while netifd is
not started yet, the ubus interface dump query will fail with "Not found",
yielding an empty response.

Subsequently, jsonfilter is invoked with an empty string instead of a valid
JSON document, causing it to emit a second "unexpected end of data" error.

This caused the dnsmasq init script to log the following errors during
early boot on some systems:

    procd: /etc/rc.d/S19dnsmasq: Command failed: Not found.
    procd: /etc/rc.d/S19dnsmasq: Failed to parse json data: unexpected end of data.

Fix the issue by allowing the ubus query to fail with "Not found" but still
logging other failures, and by passing an empty JSON object to jsonfilter
if the interface status cache is empty.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-07-17 08:10:20 +02:00
..
bin linux-atm: add br2684ctl option to specify the netdev name 2018-01-10 08:08:53 +01:00
etc base-files: fix links in banner.failsafe 2018-06-18 07:10:15 +02:00
lib base-files: network.sh: gracefully handle missing network.interface ubus ns 2018-07-17 08:10:20 +02:00
rom rename default/ to files/ 2006-11-22 23:30:57 +00:00
sbin basefiles: Reword sysupgrade message 2018-07-08 09:41:53 +01:00
usr base-files: add menuconfig option for HOME_URL 2018-06-27 08:40:34 +02:00