Blame SOURCES/elinks-0.11.0-getaddrinfo.patch

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