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:
parent
cfd597c603
commit
1ed8b0e7b4
@ -7749,18 +7749,18 @@ retry:
|
|||||||
error = dns_connect(so->udp, (struct sockaddr *)&so->remote, dns_sa_len(&so->remote));
|
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);
|
dns_trace_sys_connect(so->trace, so->udp, SOCK_DGRAM, (struct sockaddr *)&so->remote, error);
|
||||||
|
|
||||||
/* Linux returns EINVAL when address was bound to
|
#if __linux
|
||||||
localhost and it's external IP address now. */
|
/* Linux returns EINVAL when address was once bound to
|
||||||
|
localhost and the socket is reused for an external
|
||||||
|
IP address now. */
|
||||||
if (error == EINVAL) {
|
if (error == EINVAL) {
|
||||||
struct sockaddr unspec_addr;
|
struct sockaddr unspec_addr;
|
||||||
memset (&unspec_addr, 0, sizeof unspec_addr);
|
memset (&unspec_addr, 0, sizeof unspec_addr);
|
||||||
unspec_addr.sa_family = AF_UNSPEC;
|
unspec_addr.sa_family = AF_UNSPEC;
|
||||||
connect(so->udp, &unspec_addr, sizeof unspec_addr);
|
connect(so->udp, &unspec_addr, sizeof unspec_addr);
|
||||||
goto udp_connect_retry;
|
goto udp_connect_retry;
|
||||||
} else if (error == ECONNREFUSED)
|
}
|
||||||
/* Error for previous socket operation may
|
#endif
|
||||||
be reserved(?) asynchronously. */
|
|
||||||
goto udp_connect_retry;
|
|
||||||
|
|
||||||
if (error)
|
if (error)
|
||||||
goto error;
|
goto error;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user