odhcp6c: add 464xlat integration, fix dslite integration
authorSteven Barth <cyrus@openwrt.org>
Thu, 9 Apr 2015 08:17:32 +0000 (08:17 +0000)
committerSteven Barth <cyrus@openwrt.org>
Thu, 9 Apr 2015 08:17:32 +0000 (08:17 +0000)
Signed-off-by: Steven Barth <steven@midlink.org>
SVN-Revision: 45323

package/network/ipv6/odhcp6c/Makefile
package/network/ipv6/odhcp6c/files/dhcpv6.script
package/network/ipv6/odhcp6c/files/dhcpv6.sh

index d783abad2c9e267fdc812671f4e6bafb079eaffb..92b5e717bea8cf77564169360852d5c27821084f 100644 (file)
@@ -8,14 +8,14 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=odhcp6c
-PKG_VERSION:=2015-03-31
+PKG_VERSION:=2015-04-09
 PKG_RELEASE=$(PKG_SOURCE_VERSION)
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
 PKG_SOURCE_URL:=https://github.com/sbyx/odhcp6c.git
 PKG_SOURCE_PROTO:=git
-PKG_SOURCE_VERSION:=ec864c44e9959a5d65cc564182f4e960e47c6e9e
+PKG_SOURCE_VERSION:=5d19cd6e4fece1301608b975dd639d751faa1b94
 PKG_MAINTAINER:=Steven Barth <steven@midlink.org>
 PKG_LICENSE:=GPL-2.0
 
index 1acad1994cf79421b86c1fefadc2d4fa10b9c319..000e2dbae90ed59a201296d0dbaa33b9e118e695 100755 (executable)
@@ -127,19 +127,31 @@ setup_interface () {
                [ -n "$IFACE_MAP_DELEGATE" ] && json_add_boolean delegate "$IFACE_MAP_DELEGATE"
                json_close_object
                ubus call network add_dynamic "$(json_dump)"
-       elif [ -n "$AFTR_IP" -a "$IFACE_DSLITE" != 0 -a -f /lib/netifd/proto/dslite.sh ]; then
+       elif [ -n "$AFTR" -a "$IFACE_DSLITE" != 0 -a -f /lib/netifd/proto/dslite.sh ]; then
                [ -z "$IFACE_DSLITE" -o "$IFACE_DSLITE" = 1 ] && IFACE_DSLITE=${INTERFACE}_dslite
                json_init
                json_add_string name "$IFACE_DSLITE"
                json_add_string ifname "@$INTERFACE"
                json_add_string proto "dslite"
-               json_add_string peeraddr "$AFTR_IP"
+               json_add_string peeraddr "$AFTR"
                json_add_string tunlink "$INTERFACE"
                [ -n "$ZONE_DSLITE" ] || ZONE_DSLITE=$ZONE
                [ -n "$ZONE_DSLITE" ] && json_add_string zone "$ZONE_DSLITE"
                [ -n "$IFACE_DSLITE_DELEGATE" ] && json_add_boolean delegate "$IFACE_DSLITE_DELEGATE"
                json_close_object
                ubus call network add_dynamic "$(json_dump)"
+       elif [ "$IFACE_464XLAT" != 0 -a -f /lib/netifd/proto/464xlat.sh ]; then
+               [ -z "$IFACE_464XLAT" -o "$IFACE_464XLAT" = 1 ] && IFACE_464XLAT=${INTERFACE}_464xlat
+               json_init
+               json_add_string name "$IFACE_464XLAT"
+               json_add_string ifname "@$INTERFACE"
+               json_add_string proto "464xlat"
+               json_add_string tunlink "$INTERFACE"
+               [ -n "$ZONE_464XLAT" ] || ZONE_464XLAT=$ZONE
+               [ -n "$ZONE_464XLAT" ] && json_add_string zone "$ZONE_464XLAT"
+               [ -n "$IFACE_464XLAT_DELEGATE" ] && json_add_boolean delegate "$IFACE_464XLAT_DELEGATE"
+               json_close_object
+               ubus call network add_dynamic "$(json_dump)"
        fi
 
        # TODO: $SNTP_IP $SIP_IP $SNTP_FQDN $SIP_DOMAIN
index 5914abe0bb61632b528336b77b0c0899b72301af..9fb6fa342fa5540eb544f435c5ab32960bd32a2d 100755 (executable)
@@ -19,6 +19,8 @@ proto_dhcpv6_init_config() {
        proto_config_add_string zone_dslite
        proto_config_add_string iface_map
        proto_config_add_string zone_map
+       proto_config_add_string iface_464xlat
+       proto_config_add_string zone_464xlat
        proto_config_add_string zone
        proto_config_add_string 'ifaceid:ip6addr'
        proto_config_add_string 'sourcerouting:bool'
@@ -33,8 +35,8 @@ proto_dhcpv6_setup() {
        local config="$1"
        local iface="$2"
 
-       local reqaddress reqprefix clientid reqopts noslaaconly forceprefix norelease ip6prefix iface_dslite iface_map ifaceid sourcerouting userclass vendorclass delegate zone_dslite zone_map zone soltimeout fakeroutes
-       json_get_vars reqaddress reqprefix clientid reqopts noslaaconly forceprefix norelease ip6prefix iface_dslite iface_map ifaceid sourcerouting userclass vendorclass delegate zone_dslite zone_map zone soltimeout fakeroutes
+       local reqaddress reqprefix clientid reqopts noslaaconly forceprefix norelease ip6prefix iface_dslite iface_map iface_464xlat ifaceid sourcerouting userclass vendorclass delegate zone_dslite zone_map zone_464xlat zone soltimeout fakeroutes
+       json_get_vars reqaddress reqprefix clientid reqopts noslaaconly forceprefix norelease ip6prefix iface_dslite iface_map iface_464xlat ifaceid sourcerouting userclass vendorclass delegate zone_dslite zone_map zone_464xlat zone soltimeout fakeroutes
 
 
        # Configure
@@ -67,11 +69,13 @@ proto_dhcpv6_setup() {
        [ -n "$ip6prefix" ] && proto_export "USERPREFIX=$ip6prefix"
        [ -n "$iface_dslite" ] && proto_export "IFACE_DSLITE=$iface_dslite"
        [ -n "$iface_map" ] && proto_export "IFACE_MAP=$iface_map"
+       [ -n "$iface_464xlat" ] && proto_export "IFACE_464XLAT=$iface_464xlat"
        [ "$sourcerouting" != "0" ] && proto_export "SOURCE_ROUTING=1"
        [ "$delegate" = "0" ] && proto_export "IFACE_DSLITE_DELEGATE=0"
        [ "$delegate" = "0" ] && proto_export "IFACE_MAP_DELEGATE=0"
        [ -n "$zone_dslite" ] && proto_export "ZONE_DSLITE=$zone_dslite"
        [ -n "$zone_map" ] && proto_export "ZONE_MAP=$zone_map"
+       [ -n "$zone_464xlat" ] && proto_export "ZONE_464XLAT=$zone_464xlat"
        [ -n "$zone" ] && proto_export "ZONE=$zone"
        [ "$fakeroutes" != "0" ] && proto_export "FAKE_ROUTES=1"