diff options
author | Steven Barth <cyrus@openwrt.org> | 2015-10-15 08:56:59 +0000 |
---|---|---|
committer | Steven Barth <cyrus@openwrt.org> | 2015-10-15 08:56:59 +0000 |
commit | 8e9196d1cb981d9a68cb79a9a12b8bafc92cdabf (patch) | |
tree | 980f48e1581bb7b9a3e6b36b1ea9feb77f2bed59 /package/network/ipv6/6in4/files | |
parent | ee480b694f101c9003709b2c52aef8b994d05419 (diff) | |
download | upstream-8e9196d1cb981d9a68cb79a9a12b8bafc92cdabf.tar.gz upstream-8e9196d1cb981d9a68cb79a9a12b8bafc92cdabf.tar.bz2 upstream-8e9196d1cb981d9a68cb79a9a12b8bafc92cdabf.zip |
6in4: add tunlink option support
Signed-off-by: Steven Barth <steven@midlink.org>
SVN-Revision: 47189
Diffstat (limited to 'package/network/ipv6/6in4/files')
-rwxr-xr-x | package/network/ipv6/6in4/files/6in4.sh | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/package/network/ipv6/6in4/files/6in4.sh b/package/network/ipv6/6in4/files/6in4.sh index af2ddca1d7..59747a3783 100755 --- a/package/network/ipv6/6in4/files/6in4.sh +++ b/package/network/ipv6/6in4/files/6in4.sh @@ -27,8 +27,8 @@ proto_6in4_setup() { 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" @@ -36,11 +36,16 @@ proto_6in4_setup() { return } - ( proto_add_host_dependency "$cfg" "$peeraddr" ) + ( proto_add_host_dependency "$cfg" "$peeraddr" "$tunlink" ) [ -z "$ipaddr" ] && { - 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 @@ -68,6 +73,7 @@ proto_6in4_setup() { [ -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" @@ -135,6 +141,7 @@ proto_6in4_init_config() { 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" |