Signed-off-by: Steven Barth <steven@midlink.org>
SVN-Revision: 47189
include $(TOPDIR)/rules.mk
PKG_NAME:=6in4
include $(TOPDIR)/rules.mk
PKG_NAME:=6in4
-PKG_VERSION:=21
-PKG_RELEASE:=2
+PKG_VERSION:=22
+PKG_RELEASE:=1
PKG_LICENSE:=GPL-2.0
include $(INCLUDE_DIR)/package.mk
PKG_LICENSE:=GPL-2.0
include $(INCLUDE_DIR)/package.mk
local iface="$2"
local link="6in4-$cfg"
local iface="$2"
local link="6in4-$cfg"
- local mtu ttl tos ipaddr peeraddr ip6addr ip6prefix tunnelid username password updatekey
- json_get_vars mtu ttl tos ipaddr peeraddr ip6addr ip6prefix tunnelid username password updatekey
+ local mtu ttl tos ipaddr peeraddr ip6addr ip6prefix tunlink tunnelid username password updatekey
+ json_get_vars mtu ttl tos ipaddr peeraddr ip6addr ip6prefix tunlink tunnelid username password updatekey
[ -z "$peeraddr" ] && {
proto_notify_error "$cfg" "MISSING_ADDRESS"
[ -z "$peeraddr" ] && {
proto_notify_error "$cfg" "MISSING_ADDRESS"
- ( proto_add_host_dependency "$cfg" "$peeraddr" )
+ ( proto_add_host_dependency "$cfg" "$peeraddr" "$tunlink" )
- local wanif
- if ! network_find_wan wanif || ! network_get_ipaddr ipaddr "$wanif"; then
+ local wanif="$tunlink"
+ if [ -z "$wanif" ] && ! network_find_wan wanif; then
+ proto_notify_error "$cfg" "NO_WAN_LINK"
+ return
+ fi
+
+ if ! network_get_ipaddr ipaddr "$wanif"; then
proto_notify_error "$cfg" "NO_WAN_LINK"
return
fi
proto_notify_error "$cfg" "NO_WAN_LINK"
return
fi
[ -n "$tos" ] && json_add_string tos "$tos"
json_add_string local "$ipaddr"
json_add_string remote "$peeraddr"
[ -n "$tos" ] && json_add_string tos "$tos"
json_add_string local "$ipaddr"
json_add_string remote "$peeraddr"
+ [ -n "$tunlink" ] && json_add_string link "$tunlink"
proto_close_tunnel
proto_send_update "$cfg"
proto_close_tunnel
proto_send_update "$cfg"
proto_config_add_string "ip6addr"
proto_config_add_string "ip6prefix"
proto_config_add_string "peeraddr"
proto_config_add_string "ip6addr"
proto_config_add_string "ip6prefix"
proto_config_add_string "peeraddr"
+ proto_config_add_string "tunlink"
proto_config_add_string "tunnelid"
proto_config_add_string "username"
proto_config_add_string "password"
proto_config_add_string "tunnelid"
proto_config_add_string "username"
proto_config_add_string "password"