summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2010-11-17 19:12:28 +0000
committerJo-Philipp Wich <jow@openwrt.org>2010-11-17 19:12:28 +0000
commit8eec2f821452e859bab5a409c4aacd5f4950ad72 (patch)
tree2156dc15ffaa60bd3310056c0586df89feba2e1e
parentd0ab35c115643db40b2bece8698ecd472f4ce147 (diff)
downloadmtk-20170518-8eec2f821452e859bab5a409c4aacd5f4950ad72.zip
mtk-20170518-8eec2f821452e859bab5a409c4aacd5f4950ad72.tar.gz
mtk-20170518-8eec2f821452e859bab5a409c4aacd5f4950ad72.tar.bz2
6to4: implement metric option
SVN-Revision: 24021
-rw-r--r--package/6to4/Makefile2
-rwxr-xr-xpackage/6to4/files/6to4.sh5
2 files changed, 5 insertions, 2 deletions
diff --git a/package/6to4/Makefile b/package/6to4/Makefile
index cf9f741..3becce9 100644
--- a/package/6to4/Makefile
+++ b/package/6to4/Makefile
@@ -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
diff --git a/package/6to4/files/6to4.sh b/package/6to4/files/6to4.sh
index bbf8dba..31dd4b7 100755
--- a/package/6to4/files/6to4.sh
+++ b/package/6to4/files/6to4.sh
@@ -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
}