ds-lite: compatibility with ISPs that only offer public PDs
authorSteven Barth <cyrus@openwrt.org>
Tue, 8 Apr 2014 06:19:37 +0000 (06:19 +0000)
committerSteven Barth <cyrus@openwrt.org>
Tue, 8 Apr 2014 06:19:37 +0000 (06:19 +0000)
SVN-Revision: 40422

package/network/ipv6/ds-lite/Makefile
package/network/ipv6/ds-lite/files/dslite.sh

index a806f67ab930cfc51df8e07814820b8e9f4cf438..61c57c092c49e0b2585b5cba7a0be82a166e8bbf 100644 (file)
@@ -8,7 +8,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=ds-lite
-PKG_VERSION:=2
+PKG_VERSION:=3
 PKG_RELEASE:=1
 
 include $(INCLUDE_DIR)/package.mk
index f4efa1c4c331a7de4df1739cc321e62fb55cc32d..670f93cd6ec12e2197d86aae218ce8c9aa415d20 100755 (executable)
@@ -14,8 +14,8 @@ proto_dslite_setup() {
        local iface="$2"
        local link="dslite-$cfg"
 
-       local mtu ttl peeraddr ip6addr tunlink zone
-       json_get_vars mtu ttl peeraddr ip6addr tunlink zone
+       local mtu ttl peeraddr ip6addr tunlink zone weakif
+       json_get_vars mtu ttl peeraddr ip6addr tunlink zone weakif
 
        [ -z "$peeraddr" ] && {
                proto_notify_error "$cfg" "MISSING_ADDRESS"
@@ -33,8 +33,11 @@ proto_dslite_setup() {
                fi
 
                if ! network_get_ipaddr6 ip6addr "$wanif"; then
-                       proto_notify_error "$cfg" "NO_WAN_LINK"
-                       return
+                       [ -z "$weakif" ] && weakif="lan"
+                       if ! network_get_ipaddr6 ip6addr "$weakif"; then
+                               proto_notify_error "$cfg" "NO_WAN_LINK"
+                               return
+                       fi
                fi
        }
 
@@ -72,6 +75,7 @@ proto_dslite_init_config() {
        proto_config_add_int "mtu"
        proto_config_add_int "ttl"
        proto_config_add_string "zone"
+       proto_config_add_string "weakif"
 }
 
 [ -n "$INCLUDE_ONLY" ] || {