aboutsummaryrefslogtreecommitdiff
path: root/src/dns.c
diff options
context:
space:
mode:
authorJohannes Hofmann <Johannes.Hofmann@gmx.de>2012-12-01 23:12:29 +0100
committerJohannes Hofmann <Johannes.Hofmann@gmx.de>2012-12-01 23:12:29 +0100
commitb58490c558fa16197c22354c892293bd6e527ce8 (patch)
tree09d8e29ee4355a22552022bc5099e6bd3ff0ad44 /src/dns.c
parent414903e3732bd6baa3dd0306fe79fd0d9901143f (diff)
ask for ipv4 addresses only in getaddrinfo() if ipv6 is disabled
This speeds up dns requests quite a bit in my setup.
Diffstat (limited to 'src/dns.c')
-rw-r--r--src/dns.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/dns.c b/src/dns.c
index 3989701d..c24838e3 100644
--- a/src/dns.c
+++ b/src/dns.c
@@ -284,7 +284,11 @@ static void *Dns_server(void *data)
char addr_string[40];
memset(&hints, 0, sizeof(hints));
+#ifdef ENABLE_IPV6
hints.ai_family = AF_UNSPEC;
+#else
+ hints.ai_family = AF_INET;
+#endif
hints.ai_socktype = SOCK_STREAM;
hosts = dList_new(2);