summaryrefslogtreecommitdiff
path: root/package/base-files
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2012-06-29 11:58:35 +0000
committerJo-Philipp Wich <jow@openwrt.org>2012-06-29 11:58:35 +0000
commite6540143528fdb573163f1be9b99be1a99027bd0 (patch)
tree9fa164c145df4dff9d49f6f25261d31fdf0a6563 /package/base-files
parent1f8d8dca76707a5a89e59e574d797c0855e2d02b (diff)
downloadmtk-20170518-e6540143528fdb573163f1be9b99be1a99027bd0.zip
mtk-20170518-e6540143528fdb573163f1be9b99be1a99027bd0.tar.gz
mtk-20170518-e6540143528fdb573163f1be9b99be1a99027bd0.tar.bz2
base-files: only consider enabled default routes when finding the wan iface (#11774)
SVN-Revision: 32525
Diffstat (limited to 'package/base-files')
-rw-r--r--package/base-files/files/lib/functions/network.sh6
1 files changed, 4 insertions, 2 deletions
diff --git a/package/base-files/files/lib/functions/network.sh b/package/base-files/files/lib/functions/network.sh
index 7475b00..c6b98e6 100644
--- a/package/base-files/files/lib/functions/network.sh
+++ b/package/base-files/files/lib/functions/network.sh
@@ -49,6 +49,7 @@ __network_gateway()
local __tmp="$(ubus call network.interface."$__iface" status 2>/dev/null)"
local __idx=1
+ local __enabled
json_load "${__tmp:-{}}"
@@ -60,9 +61,10 @@ __network_gateway()
json_select "$((__idx++))"
json_get_var __tmp target
+ json_get_var __enabled enabled
- case "${__family}/${__tmp}" in
- 4/0.0.0.0|6/::)
+ case "${__enabled}/${__family}/${__tmp}" in
+ 1/4/0.0.0.0|1/6/::)
json_get_var "$__var" nexthop
return $?
;;