From 60f054fcf93759b88d6f752376b08610ea6580a9 Mon Sep 17 00:00:00 2001 From: Costa Tsaousis Date: Tue, 7 Apr 2026 23:05:01 +0300 Subject: [PATCH] dns: print failure message when EAI_AGAIN retries are exhausted MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- src/ipset_dns.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/ipset_dns.c b/src/ipset_dns.c index 2dadf65..80711af 100644 --- a/src/ipset_dns.c +++ b/src/ipset_dns.c @@ -147,6 +147,8 @@ static void dns_request_failed(DNSREQ *d, int added, int gai_error) dns_unlock_requests(); return; } + if(!dns_silent) + fprintf(stderr, "%s: DNS: '%s' failed permanently after retries: %s\n", PROG, d->hostname, gai_strerror(gai_error)); dns_request_done(d, added); return;