6rd: add support for native IPv6 prefix handling
authorSteven Barth <cyrus@openwrt.org>
Tue, 15 Jan 2013 13:08:14 +0000 (13:08 +0000)
committerSteven Barth <cyrus@openwrt.org>
Tue, 15 Jan 2013 13:08:14 +0000 (13:08 +0000)
SVN-Revision: 35173

package/network/ipv6/6rd/Makefile
package/network/ipv6/6rd/files/6rd.sh

index 3d4549674fb7482e6e8928aeeddc8511fdea8332..f64cab3fe0af7e95009cfd10c1ef17eb0560cda1 100644 (file)
@@ -8,7 +8,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=6rd
-PKG_VERSION:=2
+PKG_VERSION:=3
 PKG_RELEASE:=1
 
 include $(INCLUDE_DIR)/package.mk
index 59c3169b39a2aabc7666c2adb2a3b4db4e7b597b..b681f2bbe6b2261c7a1092c4d31e405d5c3b787e 100644 (file)
@@ -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