1
0
mirror of git://git.gnupg.org/gnupg.git synced 2025-04-17 15:44:34 +02:00

dirmngr: Fix libdns with 127.0.0.1.

* dirmngr/dns.c (dns_so_check): Ifdef-out Linux specific code.  Remove
retrying udp_connect_retry when ECONNREFUSED.

--

Fixes-commit: bcdbf8b8ebe9d61160e0b007dabe1b6462ffbc93
GnuPG-bug-id: 4021
Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
This commit is contained in:
NIIBE Yutaka 2025-04-07 10:57:27 +09:00
parent cfd597c603
commit 1ed8b0e7b4
No known key found for this signature in database
GPG Key ID: 640114AF89DE6054

View File

@ -7749,18 +7749,18 @@ retry:
error = dns_connect(so->udp, (struct sockaddr *)&so->remote, dns_sa_len(&so->remote));
dns_trace_sys_connect(so->trace, so->udp, SOCK_DGRAM, (struct sockaddr *)&so->remote, error);
/* Linux returns EINVAL when address was bound to
localhost and it's external IP address now. */
#if __linux
/* Linux returns EINVAL when address was once bound to
localhost and the socket is reused for an external
IP address now. */
if (error == EINVAL) {
struct sockaddr unspec_addr;
memset (&unspec_addr, 0, sizeof unspec_addr);
unspec_addr.sa_family = AF_UNSPEC;
connect(so->udp, &unspec_addr, sizeof unspec_addr);
goto udp_connect_retry;
} else if (error == ECONNREFUSED)
/* Error for previous socket operation may
be reserved(?) asynchronously. */
goto udp_connect_retry;
}
#endif
if (error)
goto error;