diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2012-10-14 09:17:14 +0000 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2012-10-14 09:17:14 +0000 |
commit | a00110a063815deb4ec5a442189441dbca5dead3 (patch) | |
tree | ced31cd12c60808349f3c550f62d0b6d938f9d76 /package/network/ipv6/6in4/files/6in4.sh | |
parent | 3a31553a0e5a5f889117e7019f263e3e1d3d652b (diff) | |
download | mtk-20170518-a00110a063815deb4ec5a442189441dbca5dead3.zip mtk-20170518-a00110a063815deb4ec5a442189441dbca5dead3.tar.gz mtk-20170518-a00110a063815deb4ec5a442189441dbca5dead3.tar.bz2 |
6in4: make local ip6addr optional
SVN-Revision: 33761
Diffstat (limited to 'package/network/ipv6/6in4/files/6in4.sh')
-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 71bc689..651d7b9 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}" |