summaryrefslogtreecommitdiff
path: root/lib/libc/net
diff options
context:
space:
mode:
authorJun-ichiro itojun Hagino <itojun@cvs.openbsd.org>2002-08-22 16:35:38 +0000
committerJun-ichiro itojun Hagino <itojun@cvs.openbsd.org>2002-08-22 16:35:38 +0000
commitdbbfd7f309a55b8320c8d78ba6adc4a8c40be916 (patch)
tree1d62f5cf5397dbd92c1a2c569a7b569497f6a2d0 /lib/libc/net
parent7954c13f8e449c13b236cc9f51ec78c89997117b (diff)
drop AAAA reply with IPv4 mapped address. sync w/kame
draft-itojun-v6ops-v4mapped-harmful-00.txt
Diffstat (limited to 'lib/libc/net')
-rw-r--r--lib/libc/net/getaddrinfo.c10
-rw-r--r--lib/libc/net/gethostnamadr.c10
2 files changed, 18 insertions, 2 deletions
diff --git a/lib/libc/net/getaddrinfo.c b/lib/libc/net/getaddrinfo.c
index 744852bed7d..db15e62668a 100644
--- a/lib/libc/net/getaddrinfo.c
+++ b/lib/libc/net/getaddrinfo.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: getaddrinfo.c,v 1.41 2002/07/25 21:13:45 deraadt Exp $ */
+/* $OpenBSD: getaddrinfo.c,v 1.42 2002/08/22 16:35:37 itojun Exp $ */
/* $KAME: getaddrinfo.c,v 1.31 2000/08/31 17:36:43 itojun Exp $ */
/*
@@ -1173,6 +1173,14 @@ getanswer(answer, anslen, qname, qtype, pai)
cp += n;
continue;
}
+ if (type == T_AAAA) {
+ struct in6_addr in6;
+ memcpy(&in6, cp, IN6ADDRSZ);
+ if (IN6_IS_ADDR_V4MAPPED(&in6)) {
+ cp += n;
+ continue;
+ }
+ }
if (!haveanswer) {
int nn;
diff --git a/lib/libc/net/gethostnamadr.c b/lib/libc/net/gethostnamadr.c
index 423fb906b87..3ac5049e72c 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.51 2002/07/30 00:45:19 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: gethostnamadr.c,v 1.52 2002/08/22 16:35:37 itojun Exp $";
#endif /* LIBC_SCCS and not lint */
#include <sys/param.h>
@@ -363,6 +363,14 @@ getanswer(answer, anslen, qname, qtype)
cp += n;
continue;
}
+ if (type == T_AAAA) {
+ struct in6_addr in6;
+ memcpy(&in6, cp, IN6ADDRSZ);
+ if (IN6_IS_ADDR_V4MAPPED(&in6)) {
+ cp += n;
+ continue;
+ }
+ }
if (!haveanswer) {
register int nn;