Blame SOURCES/elinks-0.11.0-getaddrinfo.patch

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