Blame SOURCES/elinks-0.11.0-getaddrinfo.patch

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