aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNIIBE Yutaka <[email protected]>2025-04-07 01:57:27 +0000
committerNIIBE Yutaka <[email protected]>2025-04-07 01:57:27 +0000
commit1ed8b0e7b40304368f0466b03b33c3c40becfc3c (patch)
tree48f730731ac24b184d96d3799d5f9156cd4c0647
parentgpg: New key generation parameter "User-Id". (diff)
downloadgnupg-1ed8b0e7b40304368f0466b03b33c3c40becfc3c.tar.gz
gnupg-1ed8b0e7b40304368f0466b03b33c3c40becfc3c.zip
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 <[email protected]>
-rw-r--r--dirmngr/dns.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/dirmngr/dns.c b/dirmngr/dns.c
index f023e7395..5c7bb08d8 100644
--- a/dirmngr/dns.c
+++ b/dirmngr/dns.c
@@ -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;