diff options
author | jow <jow@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2012-10-14 09:17:14 +0000 |
---|---|---|
committer | jow <jow@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2012-10-14 09:17:14 +0000 |
commit | 1f9ebae0301ec01ce95e4c1944858b0be9641464 (patch) | |
tree | d9e8b77d90394ac3c91706e1f8feb6dbc300f46d /package/network/ipv6/6in4/files | |
parent | 6c81b72b35f0d56fd0b432160b5f1aaf808d732f (diff) |
6in4: make local ip6addr optional
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@33761 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/network/ipv6/6in4/files')
-rwxr-xr-x | package/network/ipv6/6in4/files/6in4.sh | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/package/network/ipv6/6in4/files/6in4.sh b/package/network/ipv6/6in4/files/6in4.sh index 71bc68940..651d7b97b 100755 --- a/package/network/ipv6/6in4/files/6in4.sh +++ b/package/network/ipv6/6in4/files/6in4.sh @@ -17,7 +17,7 @@ proto_6in4_setup() { local 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_block_restart "$cfg" return @@ -33,14 +33,16 @@ 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" + } + proto_add_tunnel json_add_string mode sit json_add_int mtu "${mtu:-1280}" |