base-files: change network_find_wan() procedure to ignore default gateways in differe...
authorJo-Philipp Wich <jow@openwrt.org>
Mon, 6 May 2013 09:33:56 +0000 (09:33 +0000)
committerJo-Philipp Wich <jow@openwrt.org>
Mon, 6 May 2013 09:33:56 +0000 (09:33 +0000)
SVN-Revision: 36553

package/base-files/Makefile
package/base-files/files/lib/functions/network.sh

index acd5e2e198347de730522e58fcfbf5a4126e3099..050cc77b51749a331c25b5664642f2994e23ef5c 100644 (file)
@@ -11,7 +11,7 @@ include $(INCLUDE_DIR)/kernel.mk
 include $(INCLUDE_DIR)/version.mk
 
 PKG_NAME:=base-files
-PKG_RELEASE:=137
+PKG_RELEASE:=138
 
 PKG_FILE_DEPENDS:=$(PLATFORM_DIR)/ $(GENERIC_PLATFORM_DIR)/base-files/
 PKG_BUILD_DEPENDS:=opkg/host
index 369fa3dbde1bfb968435f00a4bc953f9bf6a4a7b..d86a504bf44c3f66392d5e2252e6fcadb293a687 100644 (file)
@@ -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 ".."