From bd4ec4d567494ce433865557e7896a2072f16707 Mon Sep 17 00:00:00 2001 From: jow Date: Mon, 6 May 2013 09:33:56 +0000 Subject: 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 --- package/base-files/files/lib/functions/network.sh | 24 +++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) (limited to 'package/base-files/files/lib/functions') diff --git a/package/base-files/files/lib/functions/network.sh b/package/base-files/files/lib/functions/network.sh index 369fa3dbd..d86a504bf 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 ".." -- cgit v1.2.3