mirror of
https://github.com/hak5/wifipineapple-openwrt.git
synced 2025-10-29 16:57:19 +00:00
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> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@45712 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user