diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2013-05-06 09:33:56 +0000 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2013-05-06 09:33:56 +0000 |
commit | 53b612f0496df457fdfd5f899c7a036534f7b7be (patch) | |
tree | a79cba4aa2044ebcf415befe4b3701f43f09dc85 /package/base-files/files | |
parent | 280eac850bafcf672ea0e015535df6372cec5b61 (diff) | |
download | master-187ad058-53b612f0496df457fdfd5f899c7a036534f7b7be.tar.gz master-187ad058-53b612f0496df457fdfd5f899c7a036534f7b7be.tar.bz2 master-187ad058-53b612f0496df457fdfd5f899c7a036534f7b7be.zip |
base-files: change network_find_wan() procedure to ignore default gateways in different routing tables
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@36553 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/base-files/files')
-rw-r--r-- | package/base-files/files/lib/functions/network.sh | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/package/base-files/files/lib/functions/network.sh b/package/base-files/files/lib/functions/network.sh index 369fa3dbde..d86a504bf4 100644 --- a/package/base-files/files/lib/functions/network.sh +++ b/package/base-files/files/lib/functions/network.sh @@ -80,16 +80,20 @@ __network_parse_ifstatus() while json_is_a "$__idx" object; do json_select "$((__idx++))" - json_get_var __tmp target - - case "${__tmp}" in - 0.0.0.0) - __network_set_cache "${__key}_gateway4" nexthop - ;; - ::) - __network_set_cache "${__key}_gateway6" nexthop - ;; - esac + json_get_var __tmp table + + if [ -z "$__tmp" ]; then + json_get_var __tmp target + + case "${__tmp}" in + 0.0.0.0) + __network_set_cache "${__key}_gateway4" nexthop + ;; + ::) + __network_set_cache "${__key}_gateway6" nexthop + ;; + esac + fi json_select ".." |