summaryrefslogtreecommitdiff
path: root/lib/libc
diff options
context:
space:
mode:
authorJun-ichiro itojun Hagino <itojun@cvs.openbsd.org>2000-01-18 10:20:01 +0000
committerJun-ichiro itojun Hagino <itojun@cvs.openbsd.org>2000-01-18 10:20:01 +0000
commit8d3c40a4fb3cf97213389d9b0ad37dcdc68405e0 (patch)
tree70b545d4610b159b135830b2b92efb84aa7efb90 /lib/libc
parent948c83daf61028e2499f72931ed9ae86fc0490c3 (diff)
sync comment with code. remove #if 0'ed portion (AF filtering on name
resolution) and add comment there.
Diffstat (limited to 'lib/libc')
-rw-r--r--lib/libc/net/getaddrinfo.c20
1 files changed, 5 insertions, 15 deletions
diff --git a/lib/libc/net/getaddrinfo.c b/lib/libc/net/getaddrinfo.c
index d4cd76b30c0..d06d4e96fbc 100644
--- a/lib/libc/net/getaddrinfo.c
+++ b/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.