diff options
author | Jonas Gorski <jogo@openwrt.org> | 2015-05-22 10:24:30 +0000 |
---|---|---|
committer | Jonas Gorski <jogo@openwrt.org> | 2015-05-22 10:24:30 +0000 |
commit | 5caa23551ed62186298079f30e6748570c3027d5 (patch) | |
tree | 50bb02c7d1ca5050df01754198fd1e520bf89343 /package/network/ipv6 | |
parent | 76d079204df113afa9e382a43abb5e1a2135150d (diff) | |
download | upstream-5caa23551ed62186298079f30e6748570c3027d5.tar.gz upstream-5caa23551ed62186298079f30e6748570c3027d5.tar.bz2 upstream-5caa23551ed62186298079f30e6748570c3027d5.zip |
ds-lite: fix resolve retry for fqdn peeraddrs
If the first resolveip call will fail, peeraddr will be now empty, and
the subsequent resolveip call will try to resolve an empty string.
Fix this by storing the result in a temporary variable.
Signed-off-by: Jonas Gorski <jogo@openwrt.org>
SVN-Revision: 45712
Diffstat (limited to 'package/network/ipv6')
-rw-r--r-- | package/network/ipv6/ds-lite/Makefile | 2 | ||||
-rwxr-xr-x | package/network/ipv6/ds-lite/files/dslite.sh | 11 |
2 files changed, 7 insertions, 6 deletions
diff --git a/package/network/ipv6/ds-lite/Makefile b/package/network/ipv6/ds-lite/Makefile index a232a1c58d..8c22c46a15 100644 --- a/package/network/ipv6/ds-lite/Makefile +++ b/package/network/ipv6/ds-lite/Makefile @@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=ds-lite -PKG_VERSION:=6 +PKG_VERSION:=7 PKG_RELEASE:=1 PKG_LICENSE:=GPL-2.0 diff --git a/package/network/ipv6/ds-lite/files/dslite.sh b/package/network/ipv6/ds-lite/files/dslite.sh index e849b15b94..a7e0a10542 100755 --- a/package/network/ipv6/ds-lite/files/dslite.sh +++ b/package/network/ipv6/ds-lite/files/dslite.sh @@ -13,6 +13,7 @@ proto_dslite_setup() { local cfg="$1" local iface="$2" local link="ds-$cfg" + local remoteip6 local mtu ttl peeraddr ip6addr tunlink zone weakif json_get_vars mtu ttl peeraddr ip6addr tunlink zone weakif @@ -25,16 +26,16 @@ proto_dslite_setup() { ( proto_add_host_dependency "$cfg" "::" "$tunlink" ) - peeraddr=$(resolveip -6 $peeraddr) - if [ -z "$peeraddr" ]; then + remoteip6=$(resolveip -6 $peeraddr) + if [ -z "$remoteip6" ]; then sleep 3 - peeraddr=$(resolveip -6 $peeraddr) - if [ -z "$peeraddr" ]; then + remoteip6=$(resolveip -6 $peeraddr) + if [ -z "$remoteip6" ]; then proto_notify_error "$cfg" "AFTR_DNS_FAIL" return fi fi - peeraddr="${peeraddr%% *}" + peeraddr="${remoteip6%% *}" [ -z "$ip6addr" ] && { local wanif="$tunlink" |