From 7dd97d7f0c7cd1cf2a9808b2826f2dc8cb7ca334 Mon Sep 17 00:00:00 2001 From: Jun-ichiro itojun Hagino Date: Sat, 18 May 2002 00:06:43 +0000 Subject: do not reverse-lookup scoped ipv6 address - it is meaningless as there's no way to pass scope id. sync w/kame --- lib/libc/net/gethostnamadr.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'lib/libc') 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 @@ -676,6 +676,12 @@ gethostbyaddr(addr, len, af) return (res); } + 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))) { -- cgit v1.2.3