ds-lite: add support for fqdn peeraddrs
authorSteven Barth <cyrus@openwrt.org>
Thu, 9 Apr 2015 08:17:23 +0000 (08:17 +0000)
committerSteven Barth <cyrus@openwrt.org>
Thu, 9 Apr 2015 08:17:23 +0000 (08:17 +0000)
Signed-off-by: Steven Barth <steven@midlink.org>
SVN-Revision: 45322

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

index 4a3d1b38cd8d6fd9c5f80fe4194cf8a48114f398..79b49feec38a8d4211a5d011b376f2b38e51d0c6 100644 (file)
@@ -8,7 +8,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=ds-lite
-PKG_VERSION:=4
+PKG_VERSION:=5
 PKG_RELEASE:=1
 PKG_LICENSE:=GPL-2.0
 
@@ -17,7 +17,7 @@ include $(INCLUDE_DIR)/package.mk
 define Package/ds-lite
   SECTION:=net
   CATEGORY:=Network
-  DEPENDS:=+kmod-ipv6 +kmod-ip6-tunnel
+  DEPENDS:=+kmod-ipv6 +kmod-ip6-tunnel +resolveip
   TITLE:=Dual-Stack Lite (DS-Lite) configuration support
   MAINTAINER:=Steven Barth <steven@midlink.org>
   PKGARCH:=all
index a526c91d31b14e2ee7dc321dc7f36c16c4fc4870..7b686390b3e8bec03dc8f28bf0f5059869a3c691 100755 (executable)
@@ -25,6 +25,17 @@ proto_dslite_setup() {
 
        ( proto_add_host_dependency "$cfg" "::" "$tunlink" )
 
+       peeraddr=$(resolveip -6 $peeraddr)
+       if [ -z "$peeraddr" ]; then
+               sleep 3
+               peeraddr=$(resolveip -6 $peeraddr)
+               if [ -z "$peeraddr" ]; then
+                       proto_notify_error "$cfg" "AFTR_DNS_FAIL"
+                       return
+               fi
+       fi
+       peeraddr="${peeraddr%% *}"
+
        [ -z "$ip6addr" ] && {
                local wanif="$tunlink"
                if [ -z "$wanif" ] && ! network_find_wan6 wanif; then