summaryrefslogtreecommitdiff
path: root/src/lib/libc/net/gethostnamadr.c
diff options
context:
space:
mode:
authoritojun <>2000-01-03 11:51:08 +0000
committeritojun <>2000-01-03 11:51:08 +0000
commite4c761043a1549e36e2e3f08aa44ca103b28ef51 (patch)
tree95ce16afdbc9a6c5dcca358921abae9014945b0e /src/lib/libc/net/gethostnamadr.c
parent49f178ab894fc1b1fa50a723a2778b7e5515f5f6 (diff)
downloadopenbsd-e4c761043a1549e36e2e3f08aa44ca103b28ef51.tar.gz
openbsd-e4c761043a1549e36e2e3f08aa44ca103b28ef51.tar.bz2
openbsd-e4c761043a1549e36e2e3f08aa44ca103b28ef51.zip
always enable IPv6 address in /etc/hosts (via _gethtent()).
clarify RES_USE_INET6. the use of this bit is not meaningful on openbsd (as we don't have mapped addr support in kernel).
Diffstat (limited to 'src/lib/libc/net/gethostnamadr.c')
-rw-r--r--src/lib/libc/net/gethostnamadr.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/lib/libc/net/gethostnamadr.c b/src/lib/libc/net/gethostnamadr.c
index 13a8eef846..bdb3729218 100644
--- a/src/lib/libc/net/gethostnamadr.c
+++ b/src/lib/libc/net/gethostnamadr.c
@@ -52,7 +52,7 @@
52 */ 52 */
53 53
54#if defined(LIBC_SCCS) && !defined(lint) 54#if defined(LIBC_SCCS) && !defined(lint)
55static char rcsid[] = "$OpenBSD: gethostnamadr.c,v 1.39 1999/12/11 08:40:17 itojun Exp $"; 55static char rcsid[] = "$OpenBSD: gethostnamadr.c,v 1.40 2000/01/03 11:51:07 itojun Exp $";
56#endif /* LIBC_SCCS and not lint */ 56#endif /* LIBC_SCCS and not lint */
57 57
58#include <sys/param.h> 58#include <sys/param.h>
@@ -825,8 +825,7 @@ _gethtent()
825 if (!(cp = strpbrk(p, " \t"))) 825 if (!(cp = strpbrk(p, " \t")))
826 goto again; 826 goto again;
827 *cp++ = '\0'; 827 *cp++ = '\0';
828 if ((_res.options & RES_USE_INET6) && 828 if (inet_pton(AF_INET6, p, host_addr) > 0) {
829 inet_pton(AF_INET6, p, host_addr) > 0) {
830 af = AF_INET6; 829 af = AF_INET6;
831 len = IN6ADDRSZ; 830 len = IN6ADDRSZ;
832 } else if (inet_pton(AF_INET, p, host_addr) > 0) { 831 } else if (inet_pton(AF_INET, p, host_addr) > 0) {