6to4: implement metric option
authorJo-Philipp Wich <jow@openwrt.org>
Wed, 17 Nov 2010 19:12:28 +0000 (19:12 +0000)
committerJo-Philipp Wich <jow@openwrt.org>
Wed, 17 Nov 2010 19:12:28 +0000 (19:12 +0000)
SVN-Revision: 24021

package/6to4/Makefile
package/6to4/files/6to4.sh

index cf9f74136b9e6c5ac74a382e55c719e151d671d1..3becce9c5f6611677f9036332d69da1fc1dd82a0 100644 (file)
@@ -8,7 +8,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=6to4
-PKG_VERSION:=1
+PKG_VERSION:=2
 PKG_RELEASE:=1
 
 include $(INCLUDE_DIR)/package.mk
index bbf8dba41b10a784f5efcb6d693a3b08d4ecef5d..31dd4b7c883f5efc1a32d769627423f5a12b3260 100755 (executable)
@@ -43,6 +43,9 @@ setup_interface_6to4() {
        local ttl
        config_get ttl "$cfg" ttl
 
+       local metric
+       config_get metric "$cfg" metric
+
        local defaultroute
        config_get_bool defaultroute "$cfg" defaultroute 1
 
@@ -91,7 +94,7 @@ setup_interface_6to4() {
 
                [ "$defaultroute" = 1 ] && {
                        logger -t "$link" " * Adding default route"
-                       ip -6 route add 2000::/3 via ::192.88.99.1 dev $link metric 1
+                       ip -6 route add 2000::/3 via ::192.88.99.1 metric ${metric:-1} dev $link
                        uci_set_state network "$cfg" defaultroute 1
                }