Skip to content

Commit

Permalink
[package] base-files: only consider enabled default routes when findi…
Browse files Browse the repository at this point in the history
…ng the wan iface (#11774)

git-svn-id: svn://svn.openwrt.org/openwrt/trunk@32525 3c298f89-4303-0410-b956-a3cf2f4a3e73
  • Loading branch information
jow committed Jun 29, 2012
1 parent b7fcfbf commit 79cdade
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions package/base-files/files/lib/functions/network.sh
Expand Up @@ -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:-{}}"

Expand All @@ -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 $?
;;
Expand Down

0 comments on commit 79cdade

Please sign in to comment.