From d3a27947fe8acdf60f4ccb0fbdf99441b079435c Mon Sep 17 00:00:00 2001
From: Jeong YunWon <jeong@youknowone.org>
Date: Tue, 4 Jun 2013 20:19:37 +0900
Subject: Retrieve reachable addresses only.

AI_ADDRCONFIG helps not to try to connect unreachable ipv6 address if
user doesn't have ipv6 network stack.
---
 src/common/network.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'src')

diff --git a/src/common/network.c b/src/common/network.c
index c3390b31..ca0923e1 100644
--- a/src/common/network.c
+++ b/src/common/network.c
@@ -205,7 +205,7 @@ net_resolve (netstore * ns, char *hostname, int port, char **real_host)
 
 	memset (&hints, 0, sizeof (struct addrinfo));
 	hints.ai_family = PF_UNSPEC; /* support ipv6 and ipv4 */
-	hints.ai_flags = AI_CANONNAME;
+	hints.ai_flags = AI_CANONNAME | AI_ADDRCONFIG;
 	hints.ai_socktype = SOCK_STREAM;
 
 	if (port == 0)
-- 
cgit 1.4.1