summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/libc/net/gethostnamadr.c5
-rw-r--r--src/lib/libc/net/resolver.38
2 files changed, 8 insertions, 5 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) {
diff --git a/src/lib/libc/net/resolver.3 b/src/lib/libc/net/resolver.3
index 27d393193d..9b2471d823 100644
--- a/src/lib/libc/net/resolver.3
+++ b/src/lib/libc/net/resolver.3
@@ -1,4 +1,4 @@
1.\" $OpenBSD: resolver.3,v 1.12 1999/07/05 04:41:00 aaron Exp $ 1.\" $OpenBSD: resolver.3,v 1.13 2000/01/03 11:51:08 itojun Exp $
2.\" 2.\"
3.\" Copyright (c) 1985, 1991, 1993 3.\" Copyright (c) 1985, 1991, 1993
4.\" The Regents of the University of California. All rights reserved. 4.\" The Regents of the University of California. All rights reserved.
@@ -171,7 +171,11 @@ This is used by the standard host lookup routine
171.Xr gethostbyname 3 . 171.Xr gethostbyname 3 .
172This option is enabled by default. 172This option is enabled by default.
173.It Dv RES_USE_INET6 173.It Dv RES_USE_INET6
174Enable support for IPv6 addresses. 174Enables support for IPv6-only applications.
175This causes IPv4 addresses to be returned as an IPv4 mapped address.
176For example, 10.1.1.1 will be returned as ::ffff:10.1.1.1.
177The option is not meaningful on
178.Ox .
175.El 179.El
176.Pp 180.Pp
177The 181The