summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoritojun <>2000-01-18 10:20:00 +0000
committeritojun <>2000-01-18 10:20:00 +0000
commit671ff41e84a4181978a3cca8f93688fd686285e7 (patch)
tree97400c61ba5e9ba1e627f4239b77207f95372a87 /src
parent8a07f19227756bde70a93fb12b48cccc18eba9c3 (diff)
downloadopenbsd-671ff41e84a4181978a3cca8f93688fd686285e7.tar.gz
openbsd-671ff41e84a4181978a3cca8f93688fd686285e7.tar.bz2
openbsd-671ff41e84a4181978a3cca8f93688fd686285e7.zip
sync comment with code. remove #if 0'ed portion (AF filtering on name
resolution) and add comment there.
Diffstat (limited to 'src')
-rw-r--r--src/lib/libc/net/getaddrinfo.c20
1 files changed, 5 insertions, 15 deletions
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 @@
1/* $OpenBSD: getaddrinfo.c,v 1.7 2000/01/17 15:58:11 itojun Exp $ */ 1/* $OpenBSD: getaddrinfo.c,v 1.8 2000/01/18 10:20:00 itojun Exp $ */
2 2
3/* 3/*
4 * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. 4 * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -42,7 +42,7 @@
42 * to let it do PF_UNSPEC (actually we never pass PF_UNSPEC to 42 * to let it do PF_UNSPEC (actually we never pass PF_UNSPEC to
43 * getipnodebyname(). 43 * getipnodebyname().
44 * - The code filters out AFs that are not supported by the kernel, 44 * - The code filters out AFs that are not supported by the kernel,
45 * when resolving FQDNs and globbing NULL hostname. Is it the right 45 * when globbing NULL hostname (to loopback, or wildcard). Is it the right
46 * thing to do? What is the relationship with post-RFC2553 AI_ADDRCONFIG 46 * thing to do? What is the relationship with post-RFC2553 AI_ADDRCONFIG
47 * in ai_flags? 47 * in ai_flags?
48 */ 48 */
@@ -440,9 +440,6 @@ explore_fqdn(pai, hostname, servname, res)
440 const char *servname; 440 const char *servname;
441 struct addrinfo **res; 441 struct addrinfo **res;
442{ 442{
443#if 0
444 int s;
445#endif
446 struct hostent *hp; 443 struct hostent *hp;
447 int h_error; 444 int h_error;
448 int af; 445 int af;
@@ -460,18 +457,11 @@ explore_fqdn(pai, hostname, servname, res)
460 sentinel.ai_next = NULL; 457 sentinel.ai_next = NULL;
461 cur = &sentinel; 458 cur = &sentinel;
462 459
463#if 0
464 /* 460 /*
465 * filter out AFs that are not supported by the kernel 461 * Do not filter unsupported AFs here. We need to honor content of
466 * XXX errno? 462 * databases (/etc/hosts, DNS and others). Otherwise we cannot
463 * replace gethostbyname() by getaddrinfo().
467 */ 464 */
468 s = socket(pai->ai_family, SOCK_DGRAM, 0);
469 if (s < 0) {
470 if (errno != EMFILE)
471 return 0;
472 } else
473 close(s);
474#endif
475 465
476 /* 466 /*
477 * if the servname does not match socktype/protocol, ignore it. 467 * if the servname does not match socktype/protocol, ignore it.