diff options
author | itojun <> | 2002-08-22 16:35:37 +0000 |
---|---|---|
committer | itojun <> | 2002-08-22 16:35:37 +0000 |
commit | 2f57fab691d36737bcf6e8db544d8562e37b4de0 (patch) | |
tree | 1d02bd1500c3890b14b3dffe133297e0ec30db60 /src | |
parent | b4a4648ac600e2b5503b5b3b519429d6ca3a6503 (diff) | |
download | openbsd-2f57fab691d36737bcf6e8db544d8562e37b4de0.tar.gz openbsd-2f57fab691d36737bcf6e8db544d8562e37b4de0.tar.bz2 openbsd-2f57fab691d36737bcf6e8db544d8562e37b4de0.zip |
drop AAAA reply with IPv4 mapped address. sync w/kame
draft-itojun-v6ops-v4mapped-harmful-00.txt
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/libc/net/getaddrinfo.c | 10 | ||||
-rw-r--r-- | src/lib/libc/net/gethostnamadr.c | 10 |
2 files changed, 18 insertions, 2 deletions
diff --git a/src/lib/libc/net/getaddrinfo.c b/src/lib/libc/net/getaddrinfo.c index 744852bed7..db15e62668 100644 --- a/src/lib/libc/net/getaddrinfo.c +++ b/src/lib/libc/net/getaddrinfo.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: getaddrinfo.c,v 1.41 2002/07/25 21:13:45 deraadt Exp $ */ | 1 | /* $OpenBSD: getaddrinfo.c,v 1.42 2002/08/22 16:35:37 itojun Exp $ */ |
2 | /* $KAME: getaddrinfo.c,v 1.31 2000/08/31 17:36:43 itojun Exp $ */ | 2 | /* $KAME: getaddrinfo.c,v 1.31 2000/08/31 17:36:43 itojun Exp $ */ |
3 | 3 | ||
4 | /* | 4 | /* |
@@ -1173,6 +1173,14 @@ getanswer(answer, anslen, qname, qtype, pai) | |||
1173 | cp += n; | 1173 | cp += n; |
1174 | continue; | 1174 | continue; |
1175 | } | 1175 | } |
1176 | if (type == T_AAAA) { | ||
1177 | struct in6_addr in6; | ||
1178 | memcpy(&in6, cp, IN6ADDRSZ); | ||
1179 | if (IN6_IS_ADDR_V4MAPPED(&in6)) { | ||
1180 | cp += n; | ||
1181 | continue; | ||
1182 | } | ||
1183 | } | ||
1176 | if (!haveanswer) { | 1184 | if (!haveanswer) { |
1177 | int nn; | 1185 | int nn; |
1178 | 1186 | ||
diff --git a/src/lib/libc/net/gethostnamadr.c b/src/lib/libc/net/gethostnamadr.c index 423fb906b8..3ac5049e72 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) |
55 | static char rcsid[] = "$OpenBSD: gethostnamadr.c,v 1.51 2002/07/30 00:45:19 deraadt Exp $"; | 55 | static char rcsid[] = "$OpenBSD: gethostnamadr.c,v 1.52 2002/08/22 16:35:37 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> |
@@ -363,6 +363,14 @@ getanswer(answer, anslen, qname, qtype) | |||
363 | cp += n; | 363 | cp += n; |
364 | continue; | 364 | continue; |
365 | } | 365 | } |
366 | if (type == T_AAAA) { | ||
367 | struct in6_addr in6; | ||
368 | memcpy(&in6, cp, IN6ADDRSZ); | ||
369 | if (IN6_IS_ADDR_V4MAPPED(&in6)) { | ||
370 | cp += n; | ||
371 | continue; | ||
372 | } | ||
373 | } | ||
366 | if (!haveanswer) { | 374 | if (!haveanswer) { |
367 | register int nn; | 375 | register int nn; |
368 | 376 | ||