- (djm) Support AI_NUMERICHOST in fake-getaddrinfo.c. Needed for recent
   canohost.c changes.
diff --git a/openbsd-compat/fake-getaddrinfo.c b/openbsd-compat/fake-getaddrinfo.c
index 7e6044a..ebf7366 100644
--- a/openbsd-compat/fake-getaddrinfo.c
+++ b/openbsd-compat/fake-getaddrinfo.c
@@ -13,7 +13,7 @@
 #include "xmalloc.h"
 #include "ssh.h"
 
-RCSID("$Id: fake-getaddrinfo.c,v 1.8 2003/05/19 00:39:37 djm Exp $");
+RCSID("$Id: fake-getaddrinfo.c,v 1.9 2003/06/04 23:48:33 djm Exp $");
 
 #ifndef HAVE_GAI_STRERROR
 char *
@@ -24,6 +24,8 @@
 		return ("no address associated with name");
 	case EAI_MEMORY:
 		return ("memory allocation failure.");
+	case EAI_NONAME:
+		return ("nodename nor servname provided, or not known");
 	default:
 		return ("unknown/invalid error.");
 	}
@@ -116,6 +118,10 @@
 		return (0);
 	}
 	
+	/* Don't try DNS if AI_NUMERICHOST is set */
+	if (hints && hints->ai_flags & AI_NUMERICHOST)
+		return (EAI_NONAME);
+	
 	hp = gethostbyname(hostname);
 	if (hp && hp->h_name && hp->h_name[0] && hp->h_addr_list[0]) {
 		struct addrinfo *cur, *prev;