aboutsummaryrefslogtreecommitdiffstats
path: root/e-util/e-host-utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'e-util/e-host-utils.c')
-rw-r--r--e-util/e-host-utils.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/e-util/e-host-utils.c b/e-util/e-host-utils.c
index c4057113df..4ca2daa6dc 100644
--- a/e-util/e-host-utils.c
+++ b/e-util/e-host-utils.c
@@ -183,10 +183,14 @@ e_gethostbyname_r (const char *name, struct hostent *host,
char *addr;
memset (&hints, 0, sizeof (struct addrinfo));
+#ifdef HAVE_AI_ADDRCONFIG
+ hints.ai_flags = AI_CANONNAME | AI_ADDRCONFIG;
+#else
hints.ai_flags = AI_CANONNAME;
+#endif
hints.ai_family = PF_UNSPEC;
- hints.ai_socktype = 0;
- hints.ai_protocol = 0;
+ hints.ai_socktype = SOCK_STREAM;
+ hints.ai_protocol = IPPROTO_TCP;
if ((retval = getaddrinfo (name, NULL, &hints, &res)) != 0) {
*herr = ai_to_herr (retval);