aboutsummaryrefslogtreecommitdiffstats
path: root/package/base-files/files/lib/functions
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2013-05-06 09:33:56 +0000
committerJo-Philipp Wich <jow@openwrt.org>2013-05-06 09:33:56 +0000
commit026271d03c28b3b88e64afe04bd3d236971cfaf2 (patch)
treec5833ecf2e1faeeb08a066e36c6690a3012eba5f /package/base-files/files/lib/functions
parent3c17fd41a44327e15f800098a9e4f913e5dbbe5a (diff)
downloadupstream-026271d03c28b3b88e64afe04bd3d236971cfaf2.tar.gz
upstream-026271d03c28b3b88e64afe04bd3d236971cfaf2.tar.bz2
upstream-026271d03c28b3b88e64afe04bd3d236971cfaf2.zip
base-files: change network_find_wan() procedure to ignore default gateways in different routing tables
SVN-Revision: 36553
Diffstat (limited to 'package/base-files/files/lib/functions')
-rw-r--r--package/base-files/files/lib/functions/network.sh24
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 ".."