aboutsummaryrefslogtreecommitdiffstats
path: root/dirmngr/dns-stuff.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2021-01-19 09:33:03 +0000
committerWerner Koch <[email protected]>2021-01-19 09:33:03 +0000
commit9500432b7ae10d98b30c58de4357e2ffb93bf795 (patch)
tree63ebc784ad1b417a75df15ccda1d2b335add61c9 /dirmngr/dns-stuff.c
parenttools: Add option --clock to watchgnupg (diff)
downloadgnupg-9500432b7ae10d98b30c58de4357e2ffb93bf795.tar.gz
gnupg-9500432b7ae10d98b30c58de4357e2ffb93bf795.zip
Require Libgcrypt 1.9
* configure.ac: Require at least Libgcrypt 1.9.0. Remove all GCRYPT_VERSION_NUMBER dependent code. -- Only Libgcrypt 1.9 implements EAX which is a mandatory algorithm in RFC4880bis. Signed-off-by: Werner Koch <[email protected]>
Diffstat (limited to 'dirmngr/dns-stuff.c')
-rw-r--r--dirmngr/dns-stuff.c24
1 files changed, 18 insertions, 6 deletions
diff --git a/dirmngr/dns-stuff.c b/dirmngr/dns-stuff.c
index cdda86d63..0edbc0442 100644
--- a/dirmngr/dns-stuff.c
+++ b/dirmngr/dns-stuff.c
@@ -2461,15 +2461,27 @@ check_inet_support (int *r_v4, int *r_v6)
log_debug ("%s: addr: %s\n", __func__, buffer);
}
}
+ }
+
+ for (ai = aibuf; ai; ai = ai->ai_next)
+ {
+ if (ai->ai_family == AF_INET)
+ *r_v4 = 1;
+ }
+ for (ai = aibuf; ai; ai = ai->ai_next)
+ {
if (ai->ai_family == AF_INET6)
{
struct sockaddr_in6 *v6addr = (struct sockaddr_in6 *)ai->ai_addr;
- if (!IN6_IS_ADDR_LINKLOCAL (&v6addr->sin6_addr))
- *r_v6 = 1;
- }
- else if (ai->ai_family == AF_INET)
- {
- *r_v4 = 1;
+ if (!IN6_IS_ADDR_LINKLOCAL (&v6addr->sin6_addr)
+ && (!*r_v4 || !IN6_IS_ADDR_LOOPBACK (&v6addr->sin6_addr)))
+ {
+ /* We only assume v6 if we do not have a v4 address or
+ * if the address is not ::1. Linklocal never
+ * indicates v6 support. */
+ *r_v6 = 1;
+ break;
+ }
}
}