aboutsummaryrefslogtreecommitdiffstats
path: root/package
diff options
context:
space:
mode:
authorSteven Barth <steven@midlink.org>2013-05-24 13:03:32 +0000
committerSteven Barth <steven@midlink.org>2013-05-24 13:03:32 +0000
commite872fe0b68ef666b2ea9874c94225561b0ab95fb (patch)
treecdc724ebf29daccef05e35429558859618c59bff /package
parentad8fbaf8a564f439508f00c6fd9097cc329834d0 (diff)
downloadupstream-e872fe0b68ef666b2ea9874c94225561b0ab95fb.tar.gz
upstream-e872fe0b68ef666b2ea9874c94225561b0ab95fb.tar.bz2
upstream-e872fe0b68ef666b2ea9874c94225561b0ab95fb.zip
AA: backport 6in4 from trunk
git-svn-id: svn://svn.openwrt.org/openwrt/branches/attitude_adjustment@36706 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package')
-rw-r--r--package/6in4/Makefile2
-rwxr-xr-xpackage/6in4/files/6in4.sh27
2 files changed, 18 insertions, 11 deletions
diff --git a/package/6in4/Makefile b/package/6in4/Makefile
index fdab290861..7090234358 100644
--- a/package/6in4/Makefile
+++ b/package/6in4/Makefile
@@ -8,7 +8,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=6in4
-PKG_VERSION:=11
+PKG_VERSION:=14
PKG_RELEASE:=1
include $(INCLUDE_DIR)/package.mk
diff --git a/package/6in4/files/6in4.sh b/package/6in4/files/6in4.sh
index 71bc68940c..647a2f89cf 100755
--- a/package/6in4/files/6in4.sh
+++ b/package/6in4/files/6in4.sh
@@ -14,10 +14,10 @@ proto_6in4_setup() {
local iface="$2"
local link="6in4-$cfg"
- local mtu ttl ipaddr peeraddr ip6addr tunnelid username password
- json_get_vars mtu ttl ipaddr peeraddr ip6addr tunnelid username password
+ local mtu ttl ipaddr peeraddr ip6addr ip6prefix tunnelid username password
+ json_get_vars mtu ttl ipaddr peeraddr ip6addr ip6prefix tunnelid username password
- [ -z "$ip6addr" -o -z "$peeraddr" ] && {
+ [ -z "$peeraddr" ] && {
proto_notify_error "$cfg" "MISSING_ADDRESS"
proto_block_restart "$cfg"
return
@@ -33,14 +33,18 @@ proto_6in4_setup() {
fi
}
- local local6="${ip6addr%%/*}"
- local mask6="${ip6addr##*/}"
- [[ "$local6" = "$mask6" ]] && mask6=
-
proto_init_update "$link" 1
- proto_add_ipv6_address "$local6" "$mask6"
proto_add_ipv6_route "::" 0
+ [ -n "$ip6addr" ] && {
+ local local6="${ip6addr%%/*}"
+ local mask6="${ip6addr##*/}"
+ [[ "$local6" = "$mask6" ]] && mask6=
+ proto_add_ipv6_address "$local6" "$mask6"
+ }
+
+ [ -n "$ip6prefix" ] && proto_add_ipv6_prefix "$ip6prefix"
+
proto_add_tunnel
json_add_string mode sit
json_add_int mtu "${mtu:-1280}"
@@ -61,8 +65,10 @@ proto_6in4_setup() {
local max=3
while [ $((++try)) -le $max ]; do
- wget -qO/dev/null "$url" 2>/dev/null && break
- sleep 1
+ ( exec wget -qO/dev/null "$url" 2>/dev/null ) &
+ local pid=$!
+ ( sleep 5; kill $pid 2>/dev/null ) &
+ wait $pid && break
done
}
}
@@ -77,6 +83,7 @@ proto_6in4_init_config() {
proto_config_add_string "ipaddr"
proto_config_add_string "ip6addr"
+ proto_config_add_string "ip6prefix"
proto_config_add_string "peeraddr"
proto_config_add_string "tunnelid"
proto_config_add_string "username"