From: Evan Hunt Date: Sat, 18 Jul 2009 21:14:57 +0000 (+0000) Subject: 2635. [bug] isc_inet_ntop() incorrectly handled 0.0/16 addresses. X-Git-Tag: v9.6.1-P1^2~1^2~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6e561e503d4c53d7899d6ebe019540c81dcd34ab;p=thirdparty%2Fbind9.git 2635. [bug] isc_inet_ntop() incorrectly handled 0.0/16 addresses. [RT #19716] --- diff --git a/CHANGES b/CHANGES index 6885521e087..92706e8c6f3 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,6 @@ +2635. [bug] isc_inet_ntop() incorrectly handled 0.0/16 addresses. + [RT #19716] + 2633. [bug] Handle 15 bit rand() functions. [RT #19783] 2632. [func] util/kit.sh: warn if documentation appears to be out of diff --git a/lib/isc/inet_ntop.c b/lib/isc/inet_ntop.c index dc053ededfb..996023ee0c4 100644 --- a/lib/isc/inet_ntop.c +++ b/lib/isc/inet_ntop.c @@ -19,7 +19,7 @@ #if defined(LIBC_SCCS) && !defined(lint) static char rcsid[] = - "$Id: inet_ntop.c,v 1.19 2007/06/19 23:47:17 tbox Exp $"; + "$Id: inet_ntop.c,v 1.19.332.1 2009/07/18 21:14:57 each Exp $"; #endif /* LIBC_SCCS and not lint */ #include @@ -169,8 +169,9 @@ inet_ntop6(const unsigned char *src, char *dst, size_t size) if (i != 0) *tp++ = ':'; /* Is this address an encapsulated IPv4? */ - if (i == 6 && best.base == 0 && - (best.len == 6 || (best.len == 5 && words[5] == 0xffff))) { + if (i == 6 && best.base == 0 && (best.len == 6 || + (best.len == 7 && words[7] != 0x0001) || + (best.len == 5 && words[5] == 0xffff))) { if (!inet_ntop4(src+12, tp, sizeof(tmp) - (tp - tmp))) return (NULL);