base-files: fix comment typo in lib/functions/network.sh Fix typo in comment. Signed-off-by: Walter Sonius <walterav1984@gmail.com> [commit title/message facelift] Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
base-files: add network_get_uptime() to /lib/functions/network.sh Add missing ubus api call for uptime value. Signed-off-by: Florian Eckert <fe@dev.tdt.de>
base-files: add network_get_metric() to /lib/functions/network.sh Signed-off-by: Florian Eckert <fe@dev.tdt.de> Signed-off-by: Hans Dedecker <dedeckeh@gmail.com> [PKG_RELEASE increase]
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>
base-files: network.sh: fix a number of IPv6 logic flaws * Change network_get_subnet6() to sensibly guess a suitable prefix Attempt to return the first non-linklocal, non-ula range, then attempt to return the first non-linklocal range and finally fall back to the previous behaviour of simply returning the first found item. * Fix network_get_ipaddrs_all() Instead of replicating the flawed logic appending a fixed ":1" suffix to IPv6 addresses, rely on network_get_ipaddrs() and network_get_ipaddrs6() to build a single list of all interface addresses. * Fix network_get_subnets6() Instead of replicating the flawed logic appending a fixed ":1" suffix to IPv6 addresses, rely on the ipv6-prefix-assignment.local-address field to figure out the proper network address. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
base-files: network.sh: properly report local IPv6 addresses Rework the network_get_ipaddr6() and network_get_ipaddrs6() functions to fetch the effective local IPv6 address of delegated prefix from the "local-address" field instead of naively hardcoding ":1" as static suffix. Fixes FS#829. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
base-files: add network_get_ipaddrs_all() Return all IPv4 and IPv6 addresses. Signed-off-by: Mathias Kresin <openwrt@kresin.me> SVN-Revision: 42856
base-files: whitespace fixes Signed-off-by: Luka Perkov <luka@openwrt.org> SVN-Revision: 42542
base-files: /lib/functions/network.sh: fix network_get_ipaddr6 When looking for the first ipaddr also consider the current prefix just like network_get_ipaddrs6 does. If ipv6-address was empty the function did not return the first ipaddr even if the list was non-empty. fixes commit 83e9122f88a002871d5cdf421cf6aa6052b7e006 Signed-off-by: Henning Schild <henning@hennsch.de> SVN-Revision: 42139
base-files: depend on jsonfilter and rewrite network.sh to use it Switches /lib/functions/network.sh from jshn based json parsing to jsonfilter expression while keeping the existing api. Expensive methods like "network_find_wan" are up to 20x faster now. Signed-off-by: Jo-Philipp Wich <jow@openwrt.org> SVN-Revision: 41281
base-files: add network_get_protocol() to /lib/functions/network.sh SVN-Revision: 39099
base-files: fix whitespaces Signed-off-by: Luka Perkov <luka@openwrt.org> SVN-Revision: 39006
base-files: reject invalid uci keys in network_get_device() and related procedures (#13886) SVN-Revision: 37345
base-files: network.sh: extend network_get_ipaddr6() / network_get_subnet6() to take ipv6-prefix-assignment into account, add further helper functions to fetch all ips of a given interface SVN-Revision: 36942
base-files: change network_find_wan() procedure to ignore default gateways in different routing tables SVN-Revision: 36553
base-files: fix network_get_prefix6 SVN-Revision: 35300
base-files: network.sh: fix typo in previous commit SVN-Revision: 35287
base-files: network.sh: simplify network_get_prefix6() SVN-Revision: 35286
base-files: add support for ipv6-prefixes in connection with netifd SVN-Revision: 35168
base-files: use json_is_a() in network.sh SVN-Revision: 34733