Blame SOURCES/elinks-0.11.0-getaddrinfo.patch

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