[backfire] merge r24020
authorJo-Philipp Wich <jow@openwrt.org>
Wed, 17 Nov 2010 19:19:02 +0000 (19:19 +0000)
committerJo-Philipp Wich <jow@openwrt.org>
Wed, 17 Nov 2010 19:19:02 +0000 (19:19 +0000)
SVN-Revision: 24024

package/base-files/Makefile
package/base-files/files/lib/network/config.sh
package/base-files/files/usr/share/udhcpc/default.script

index 530eaa8111b04575eed4f0551e0eb8597891bf44..fffb8e3b40eba975ae19ec68f1b083959e53822d 100644 (file)
@@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk
 include $(INCLUDE_DIR)/kernel.mk
 
 PKG_NAME:=base-files
-PKG_RELEASE:=43.9
+PKG_RELEASE:=43.10
 
 PKG_FILE_DEPENDS:=$(PLATFORM_DIR)/ $(GENERIC_PLATFORM_DIR)/base-files/
 PKG_BUILD_DEPENDS:=opkg/host
index bf7d15cc977942e40e09abfe7d6be52c9583ab99..0844acc18de6f8a2cce2d5c64b64e471d0f14d35 100755 (executable)
@@ -228,16 +228,17 @@ setup_interface_static() {
        config_get ip6addr "$config" ip6addr
        [ -z "$ipaddr" -o -z "$netmask" ] && [ -z "$ip6addr" ] && return 1
 
-       local gateway ip6gw dns bcast
+       local gateway ip6gw dns bcast metric
        config_get gateway "$config" gateway
        config_get ip6gw "$config" ip6gw
        config_get dns "$config" dns
        config_get bcast "$config" broadcast
+       config_get metric "$config" metric
 
        [ -z "$ipaddr" ] || $DEBUG ifconfig "$iface" "$ipaddr" netmask "$netmask" broadcast "${bcast:-+}"
        [ -z "$ip6addr" ] || $DEBUG ifconfig "$iface" add "$ip6addr"
-       [ -z "$gateway" ] || $DEBUG route add default gw "$gateway" dev "$iface"
-       [ -z "$ip6gw" ] || $DEBUG route -A inet6 add default gw "$ip6gw" dev "$iface"
+       [ -z "$gateway" ] || $DEBUG route add default gw "$gateway" ${metric:+metric $metric} dev "$iface"
+       [ -z "$ip6gw" ] || $DEBUG route -A inet6 add default gw "$ip6gw" ${metric:+metric $metric} dev "$iface"
        [ -z "$dns" ] || add_dns "$config" $dns
 
        config_get type "$config" TYPE
index 708f847839f79985c283eae2ce8a771a37e53f96..9acde829d0b76bfa0cdfd9c9085a4a38524cf6c0 100755 (executable)
@@ -19,6 +19,7 @@ setup_interface () {
        local old_dns
        local user_dns
        local user_router
+       local user_metric
 
        [ -n "$ifc" ] && {
                old_ip="$(uci_get_state network "$ifc" ipaddr)"
@@ -43,6 +44,7 @@ setup_interface () {
                change_state network "$ifc" lease_gateway "$router"
                old_router="$(uci_get_state network "$ifc" gateway)"
                user_router="$(uci_get network "$ifc" gateway)"
+               user_metric="$(uci_get network "$ifc" metric)"
                [ -n "$user_router" ] && router="$user_router"
        }
 
@@ -51,7 +53,7 @@ setup_interface () {
 
                local valid_gw=""
                for i in $router ; do
-                       route add default gw $i dev $interface
+                       route add default gw $i ${user_metric:+metric $user_metric} dev $interface
                        valid_gw="${valid_gw:+$valid_gw|}$i"
                done