From e85e8e515bae09de251355b87a08d6162266b2f0 Mon Sep 17 00:00:00 2001
From: cyrus <cyrus@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Date: Mon, 13 May 2013 17:12:25 +0000
Subject: odhcp6c: added support for DS-Lite + various fixes

git-svn-id: svn://svn.openwrt.org/openwrt/trunk@36625 3c298f89-4303-0410-b956-a3cf2f4a3e73
---
 package/network/ipv6/odhcp6c/Makefile            |  4 ++--
 package/network/ipv6/odhcp6c/files/dhcpv6.script | 14 ++++++++++++++
 package/network/ipv6/odhcp6c/files/dhcpv6.sh     |  5 +++--
 3 files changed, 19 insertions(+), 4 deletions(-)

diff --git a/package/network/ipv6/odhcp6c/Makefile b/package/network/ipv6/odhcp6c/Makefile
index 140f27a31..fd28dc89d 100644
--- a/package/network/ipv6/odhcp6c/Makefile
+++ b/package/network/ipv6/odhcp6c/Makefile
@@ -8,14 +8,14 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=odhcp6c
-PKG_VERSION:=2013-05-05
+PKG_VERSION:=2013-05-13
 PKG_RELEASE=$(PKG_SOURCE_VERSION)
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
 PKG_SOURCE_URL:=git://github.com/sbyx/odhcp6c.git
 PKG_SOURCE_PROTO:=git
-PKG_SOURCE_VERSION:=493b90de720d198a988460bee83340dafbbfa10d
+PKG_SOURCE_VERSION:=aeb7c37224051811553c898b2a784944f26276b0
 PKG_MAINTAINER:=Steven Barth <steven@midlink.org>
 
 include $(INCLUDE_DIR)/package.mk
diff --git a/package/network/ipv6/odhcp6c/files/dhcpv6.script b/package/network/ipv6/odhcp6c/files/dhcpv6.script
index c81ffee65..324a823ce 100755
--- a/package/network/ipv6/odhcp6c/files/dhcpv6.script
+++ b/package/network/ipv6/odhcp6c/files/dhcpv6.script
@@ -69,6 +69,20 @@ setup_interface () {
 
 	proto_send_update "$INTERFACE"
 
+	if [ -n "$AFTR_IP " -a -n "$IFACE_DSLITE" ]; then
+uci -q batch <<-EOF >/dev/null
+set network.$IFACE_DSLITE.proto=dslite
+set network.$IFACE_DSLITE.auto=0
+set network.$IFACE_DSLITE.peeraddr=$AFTR_IP
+set network.$IFACE_DSLITE.tunlink=$INTERFACE
+commit network
+EOF
+
+		ifdown "$IFACE_DSLITE"
+		/etc/init.d/network reload
+		ifup "$IFACE_DSLITE"
+	fi
+
 	# TODO: $SNTP_IP $SIP_IP $SNTP_FQDN $SIP_DOMAIN
 }
 
diff --git a/package/network/ipv6/odhcp6c/files/dhcpv6.sh b/package/network/ipv6/odhcp6c/files/dhcpv6.sh
index 6cf7521fe..b2264ed90 100755
--- a/package/network/ipv6/odhcp6c/files/dhcpv6.sh
+++ b/package/network/ipv6/odhcp6c/files/dhcpv6.sh
@@ -18,8 +18,8 @@ proto_dhcpv6_setup() {
 	local config="$1"
 	local iface="$2"
 
-	local reqaddress reqprefix clientid reqopts noslaaconly norelease ip6prefix
-	json_get_vars reqaddress reqprefix clientid reqopts noslaaconly norelease ip6prefix
+	local reqaddress reqprefix clientid reqopts noslaaconly norelease ip6prefix iface_dslite
+	json_get_vars reqaddress reqprefix clientid reqopts noslaaconly norelease ip6prefix iface_dslite
 
 
 	# Configure
@@ -40,6 +40,7 @@ proto_dhcpv6_setup() {
 	done
 
 	[ -n "$ip6prefix" ] && proto_export "USERPREFIX=$ip6prefix"
+	[ -n "$iface_dslite" ] && proto_export "IFACE_DSLITE=$iface_dslite"
 
 	proto_export "INTERFACE=$config"
 	proto_run_command "$config" odhcp6c \
-- 
cgit v1.2.3