summaryrefslogtreecommitdiff
path: root/package/network/ipv6/6rd/files/6rd.sh
diff options
context:
space:
mode:
authorSteven Barth <cyrus@openwrt.org>2013-01-15 13:08:14 +0000
committerSteven Barth <cyrus@openwrt.org>2013-01-15 13:08:14 +0000
commit955a1e8e28a117a1cee056cab5eb7d6ea25974b9 (patch)
tree8cc2cf745615c27c327e4e915c2c9ab81d15a3cf /package/network/ipv6/6rd/files/6rd.sh
parent811cd2acf4ff784a746c421685ef189971beb141 (diff)
downloadmtk-20170518-955a1e8e28a117a1cee056cab5eb7d6ea25974b9.zip
mtk-20170518-955a1e8e28a117a1cee056cab5eb7d6ea25974b9.tar.gz
mtk-20170518-955a1e8e28a117a1cee056cab5eb7d6ea25974b9.tar.bz2
6rd: add support for native IPv6 prefix handling
SVN-Revision: 35173
Diffstat (limited to 'package/network/ipv6/6rd/files/6rd.sh')
-rw-r--r--package/network/ipv6/6rd/files/6rd.sh4
1 files changed, 4 insertions, 0 deletions
diff --git a/package/network/ipv6/6rd/files/6rd.sh b/package/network/ipv6/6rd/files/6rd.sh
index 59c3169..b681f2b 100644
--- a/package/network/ipv6/6rd/files/6rd.sh
+++ b/package/network/ipv6/6rd/files/6rd.sh
@@ -42,8 +42,12 @@ proto_6rd_setup() {
local ip6subnet=$(6rdcalc "$ip6prefix/$ip6prefixlen" "$ipaddr/$ip4prefixlen")
local ip6addr="${ip6subnet%%::*}::1"
+ # Determine the IPv6 prefix
+ local ip6lanprefix="$ip6subnet/$(($ip6prefixlen + 32 - $ip4prefixlen))"
+
proto_init_update "$link" 1
proto_add_ipv6_address "$ip6addr" "$ip6prefixlen"
+ proto_add_ipv6_prefix "$ip6lanprefix"
proto_add_ipv6_route "::" 0 "::$peeraddr"
proto_add_tunnel