From 671ff41e84a4181978a3cca8f93688fd686285e7 Mon Sep 17 00:00:00 2001
From: itojun <>
Date: Tue, 18 Jan 2000 10:20:00 +0000
Subject: sync comment with code.  remove #if 0'ed portion (AF filtering on
 name resolution) and add comment there.

---
 src/lib/libc/net/getaddrinfo.c | 20 +++++---------------
 1 file changed, 5 insertions(+), 15 deletions(-)

(limited to 'src')

diff --git a/src/lib/libc/net/getaddrinfo.c b/src/lib/libc/net/getaddrinfo.c
index d4cd76b30c..d06d4e96fb 100644
--- a/src/lib/libc/net/getaddrinfo.c
+++ b/src/lib/libc/net/getaddrinfo.c
@@ -1,4 +1,4 @@
-/*	$OpenBSD: getaddrinfo.c,v 1.7 2000/01/17 15:58:11 itojun Exp $	*/
+/*	$OpenBSD: getaddrinfo.c,v 1.8 2000/01/18 10:20:00 itojun Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -42,7 +42,7 @@
  *   to let it do PF_UNSPEC (actually we never pass PF_UNSPEC to
  *   getipnodebyname().
  * - The code filters out AFs that are not supported by the kernel,
- *   when resolving FQDNs and globbing NULL hostname.  Is it the right
+ *   when globbing NULL hostname (to loopback, or wildcard).  Is it the right
  *   thing to do?  What is the relationship with post-RFC2553 AI_ADDRCONFIG
  *   in ai_flags?
  */
@@ -440,9 +440,6 @@ explore_fqdn(pai, hostname, servname, res)
 	const char *servname;
 	struct addrinfo **res;
 {
-#if 0
-	int s;
-#endif
 	struct hostent *hp;
 	int h_error;
 	int af;
@@ -460,18 +457,11 @@ explore_fqdn(pai, hostname, servname, res)
 	sentinel.ai_next = NULL;
 	cur = &sentinel;
 
-#if 0
 	/*
-	 * filter out AFs that are not supported by the kernel
-	 * XXX errno?
+	 * Do not filter unsupported AFs here.  We need to honor content of
+	 * databases (/etc/hosts, DNS and others).  Otherwise we cannot
+	 * replace gethostbyname() by getaddrinfo().
 	 */
-	s = socket(pai->ai_family, SOCK_DGRAM, 0);
-	if (s < 0) {
-		if (errno != EMFILE)
-			return 0;
-	} else
-		close(s);
-#endif
 
 	/*
 	 * if the servname does not match socktype/protocol, ignore it.
-- 
cgit v1.2.3-55-g6feb