Changeset 45712


Ignore:
Timestamp:
2015-05-22T12:24:30+02:00 (3 years ago)
Author:
jogo
Message:

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@…>

Location:
trunk/package/network/ipv6/ds-lite
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/package/network/ipv6/ds-lite/Makefile

    r45476 r45712  
    99 
    1010PKG_NAME:=ds-lite 
    11 PKG_VERSION:=6 
     11PKG_VERSION:=7 
    1212PKG_RELEASE:=1 
    1313PKG_LICENSE:=GPL-2.0 
  • trunk/package/network/ipv6/ds-lite/files/dslite.sh

    r45476 r45712  
    1414        local iface="$2" 
    1515        local link="ds-$cfg" 
     16        local remoteip6 
    1617 
    1718        local mtu ttl peeraddr ip6addr tunlink zone weakif 
     
    2627        ( proto_add_host_dependency "$cfg" "::" "$tunlink" ) 
    2728 
    28         peeraddr=$(resolveip -6 $peeraddr) 
    29         if [ -z "$peeraddr" ]; then 
     29        remoteip6=$(resolveip -6 $peeraddr) 
     30        if [ -z "$remoteip6" ]; then 
    3031                sleep 3 
    31                 peeraddr=$(resolveip -6 $peeraddr) 
    32                 if [ -z "$peeraddr" ]; then 
     32                remoteip6=$(resolveip -6 $peeraddr) 
     33                if [ -z "$remoteip6" ]; then 
    3334                        proto_notify_error "$cfg" "AFTR_DNS_FAIL" 
    3435                        return 
    3536                fi 
    3637        fi 
    37         peeraddr="${peeraddr%% *}" 
     38        peeraddr="${remoteip6%% *}" 
    3839 
    3940        [ -z "$ip6addr" ] && { 
Note: See TracChangeset for help on using the changeset viewer.