dirmngr: Better handle systems without IPv6 or IPv4.
authorWerner Koch <wk@gnupg.org>
Sat, 24 Oct 2015 14:27:47 +0000 (16:27 +0200)
committerWerner Koch <wk@gnupg.org>
Sun, 25 Oct 2015 15:47:12 +0000 (16:47 +0100)
* dirmngr/dns-stuff.c (resolve_name_standard): Use AI_ADDRCONFIG.

dirmngr/dns-stuff.c

index dc5cb89..d784ccf 100644 (file)
@@ -146,8 +146,9 @@ resolve_name_standard (const char *name, unsigned short port,
   memset (&hints, 0, sizeof hints);
   hints.ai_family = want_family;
   hints.ai_socktype = want_socktype;
+  hints.ai_flags = AI_ADDRCONFIG;
   if (r_canonname)
-    hints.ai_flags = AI_CANONNAME;
+    hints.ai_flags |= AI_CANONNAME;
 
   if (port)
     snprintf (portstr, sizeof portstr, "%hu", port);