1
0
mirror of git://projects.qi-hardware.com/openwrt-xburst.git synced 2024-11-24 02:48:26 +02:00

6in4: make local ip6addr optional

git-svn-id: svn://svn.openwrt.org/openwrt/trunk@33761 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
jow 2012-10-14 09:17:14 +00:00
parent 6c81b72b35
commit 1f9ebae030
2 changed files with 9 additions and 7 deletions

View File

@ -8,7 +8,7 @@
include $(TOPDIR)/rules.mk include $(TOPDIR)/rules.mk
PKG_NAME:=6in4 PKG_NAME:=6in4
PKG_VERSION:=11 PKG_VERSION:=12
PKG_RELEASE:=1 PKG_RELEASE:=1
include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/package.mk

View File

@ -17,7 +17,7 @@ proto_6in4_setup() {
local mtu ttl ipaddr peeraddr ip6addr tunnelid username password local mtu ttl ipaddr peeraddr ip6addr tunnelid username password
json_get_vars mtu ttl ipaddr peeraddr ip6addr tunnelid username password json_get_vars mtu ttl ipaddr peeraddr ip6addr tunnelid username password
[ -z "$ip6addr" -o -z "$peeraddr" ] && { [ -z "$peeraddr" ] && {
proto_notify_error "$cfg" "MISSING_ADDRESS" proto_notify_error "$cfg" "MISSING_ADDRESS"
proto_block_restart "$cfg" proto_block_restart "$cfg"
return return
@ -33,13 +33,15 @@ proto_6in4_setup() {
fi fi
} }
proto_init_update "$link" 1
proto_add_ipv6_route "::" 0
[ -n "$ip6addr" ] && {
local local6="${ip6addr%%/*}" local local6="${ip6addr%%/*}"
local mask6="${ip6addr##*/}" local mask6="${ip6addr##*/}"
[[ "$local6" = "$mask6" ]] && mask6= [[ "$local6" = "$mask6" ]] && mask6=
proto_init_update "$link" 1
proto_add_ipv6_address "$local6" "$mask6" proto_add_ipv6_address "$local6" "$mask6"
proto_add_ipv6_route "::" 0 }
proto_add_tunnel proto_add_tunnel
json_add_string mode sit json_add_string mode sit