diff options
author | jow <jow@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2012-06-29 11:58:35 +0000 |
---|---|---|
committer | jow <jow@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2012-06-29 11:58:35 +0000 |
commit | 79cdadea60cd27e9c68b907bcf83a13541fb6f04 (patch) | |
tree | 4e69bcdbc84ed1fd3dcc6688d6e957420673a48d /package/base-files/files/lib | |
parent | b7fcfbf38174d03a4a481e53ad25873fbe402552 (diff) |
[package] base-files: only consider enabled default routes when finding the wan iface (#11774)
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@32525 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/base-files/files/lib')
-rw-r--r-- | package/base-files/files/lib/functions/network.sh | 6 |
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 7475b00cba..c6b98e6e1c 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 $? ;; |