Skip to content

Commit 60f054f

Browse files
committed
dns: print failure message when EAI_AGAIN retries are exhausted
When getaddrinfo returns EAI_AGAIN ("Temporary failure in name resolution"), iprange retries the request up to 20 times. After the last retry, the request was silently completed without any final diagnostic. On systems without network connectivity (e.g. distribution package build VMs), this causes the user to see twenty "will be retried" lines and then nothing, even though the command exits non-zero. It also breaks tests.d/64-dns-failure-exit-status, which greps stderr for "failed permanently" — a string only emitted on the EAI_NONAME path. Mirror the EAI_NONAME branch and emit a "failed permanently after retries" message before completing the request, so the user (and the test) get a clear final error regardless of whether the resolver reached a server. Fixes #42
1 parent a745967 commit 60f054f

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

src/ipset_dns.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,8 @@ static void dns_request_failed(DNSREQ *d, int added, int gai_error)
147147
dns_unlock_requests();
148148
return;
149149
}
150+
if(!dns_silent)
151+
fprintf(stderr, "%s: DNS: '%s' failed permanently after retries: %s\n", PROG, d->hostname, gai_strerror(gai_error));
150152
dns_request_done(d, added);
151153
return;
152154

0 commit comments

Comments
 (0)