summaryrefslogtreecommitdiff
path: root/lib/libc/net
diff options
context:
space:
mode:
authorJun-ichiro itojun Hagino <itojun@cvs.openbsd.org>2002-05-18 00:06:43 +0000
committerJun-ichiro itojun Hagino <itojun@cvs.openbsd.org>2002-05-18 00:06:43 +0000
commit7dd97d7f0c7cd1cf2a9808b2826f2dc8cb7ca334 (patch)
treefd762ba0ba0fc6651251370bdb1c352b8a739c65 /lib/libc/net
parenta09e3f3ee15ae4301104cc873a62f18e7b6abf75 (diff)
do not reverse-lookup scoped ipv6 address - it is meaningless as there's
no way to pass scope id. sync w/kame
Diffstat (limited to 'lib/libc/net')
-rw-r--r--lib/libc/net/gethostnamadr.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/libc/net/gethostnamadr.c b/lib/libc/net/gethostnamadr.c
index 9061caf0c23..a0bee88a6df 100644
--- a/lib/libc/net/gethostnamadr.c
+++ b/lib/libc/net/gethostnamadr.c
@@ -52,7 +52,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$OpenBSD: gethostnamadr.c,v 1.45 2002/02/17 19:42:23 millert Exp $";
+static char rcsid[] = "$OpenBSD: gethostnamadr.c,v 1.46 2002/05/18 00:06:42 itojun Exp $";
#endif /* LIBC_SCCS and not lint */
#include <sys/param.h>
@@ -677,6 +677,12 @@ gethostbyaddr(addr, len, af)
}
if (af == AF_INET6 && len == IN6ADDRSZ &&
+ (IN6_IS_ADDR_LINKLOCAL((struct in6_addr *)uaddr) ||
+ IN6_IS_ADDR_SITELOCAL((struct in6_addr *)uaddr))) {
+ h_errno = HOST_NOT_FOUND;
+ return (NULL);
+ }
+ if (af == AF_INET6 && len == IN6ADDRSZ &&
(IN6_IS_ADDR_V4MAPPED((struct in6_addr *)uaddr) ||
IN6_IS_ADDR_V4COMPAT((struct in6_addr *)uaddr))) {
/* Unmap. */