remove some no-DNS related logic

... from "Further IP addresses" and before calling ``get_aaaa_record``
in ``determine_ip_addresses()``. Logic appeared needlessly to difficult
and was as far as the "Further IP addresses" line was concerned incomplete.
This commit is contained in:
Dirk 2018-04-12 00:53:26 +02:00
parent 557942cb0a
commit 9f0e442b9f

View File

@ -14134,19 +14134,7 @@ determine_ip_addresses() {
local ip6="" local ip6=""
ip4=$(get_a_record $NODE) ip4=$(get_a_record $NODE)
# Get_a_record / get_aaaa_record returns immediately if NODNS is "none", ip6=$(get_aaaa_record $NODE)
# however there are edge case we want to consider to avoid an unnecessary lookup.
# If we have an IPv4 record already and minimum DNS lookups were requested the IPv6 lookup can be skipped.
# It needs to be done though if an IPv6 check was requested and the IPv4 lookup failed.
if [[ -n "$ip4" ]] && [[ -n "$NODNS" ]]; then
:
elif [[ -z "$NODNS" ]]; then
ip6=$(get_aaaa_record $NODE)
elif [[ -z "$ip4" ]] && [[ "$NODNS" == min ]] && "$HAS_IPv6"; then
ip6=$(get_aaaa_record $NODE)
else
outln "fixme"
fi
IP46ADDRs=$(newline_to_spaces "$ip4 $ip6") IP46ADDRs=$(newline_to_spaces "$ip4 $ip6")
if [[ -n "$CMDLINE_IP" ]]; then if [[ -n "$CMDLINE_IP" ]]; then
@ -14473,18 +14461,14 @@ display_rdns_etc() {
fi fi
if [[ $(count_words "$IP46ADDRs") -gt 1 ]]; then if [[ $(count_words "$IP46ADDRs") -gt 1 ]]; then
out " Further IP addresses: $CORRECT_SPACES" out " Further IP addresses: $CORRECT_SPACES"
if [[ -n "$NODNS" ]]; then for ip in $IP46ADDRs; do
prln_warning "(instructed to minimize DNS queries)" if [[ "$ip" == "$NODEIP" ]] || [[ "[$ip]" == "$NODEIP" ]]; then
else continue
for ip in $IP46ADDRs; do else
if [[ "$ip" == "$NODEIP" ]] || [[ "[$ip]" == "$NODEIP" ]]; then further_ip_addrs+="$ip "
continue fi
else done
further_ip_addrs+="$ip " outln "$(out_row_aligned_max_width "$further_ip_addrs" " $CORRECT_SPACES" $TERM_WIDTH)"
fi
done
outln "$(out_row_aligned_max_width "$further_ip_addrs" " $CORRECT_SPACES" $TERM_WIDTH)"
fi
fi fi
if "$LOCAL_A"; then if "$LOCAL_A"; then
outln " A record via $CORRECT_SPACES /etc/hosts " outln " A record via $CORRECT_SPACES /etc/hosts "