Blame SOURCES/elinks-0.11.0-getaddrinfo.patch

68f3b8
--- elinks-0.11.0/src/network/dns.c.getaddrinfo	2006-01-01 17:39:36.000000000 +0100
68f3b8
+++ elinks-0.11.0/src/network/dns.c	2006-01-10 09:30:56.000000000 +0100
68f3b8
@@ -157,9 +157,21 @@ do_real_lookup(unsigned char *name, struct sockaddr_storage **addrs, int *addrno
68f3b8
 	 * But we duplicate the code terribly here :|. */
68f3b8
 	/* hostent = getipnodebyname(name, AF_INET6, AI_ALL | AI_ADDRCONFIG, NULL); */
68f3b8
 	memset(&hint, 0, sizeof(hint));
68f3b8
+	hint.ai_flags = AI_ADDRCONFIG;
68f3b8
 	hint.ai_family = AF_UNSPEC;
68f3b8
 	hint.ai_socktype = SOCK_STREAM;
68f3b8
-	if (getaddrinfo(name, NULL, &hint, &ai) != 0) return DNS_ERROR;
68f3b8
+	switch (getaddrinfo(name, NULL, &hint, &ai))
68f3b8
+	{
68f3b8
+	case 0:
68f3b8
+		break;
68f3b8
+	case EAI_BADFLAGS:
68f3b8
+		hint.ai_flags = 0;
68f3b8
+		if (getaddrinfo(name, NULL, &hint, &ai) == 0)
68f3b8
+			break;
68f3b8
+		/* fall through */
68f3b8
+	default:
68f3b8
+		return DNS_ERROR;
68f3b8
+	}
68f3b8
 
68f3b8
 #else
68f3b8
 	/* Seems there are problems on Mac, so we first need to try