From: Evan Hunt Date: Sat, 18 Jul 2009 21:13:55 +0000 (+0000) Subject: 2635. [bug] isc_inet_ntop() incorrectly handled 0.0/16 addresses. X-Git-Tag: v9.4.3-P1~4^2~8 X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=2b7c68e9bb5f3b9b3209eb139c51159966a26a66;p=thirdparty%2Fbind9.git 2635. [bug] isc_inet_ntop() incorrectly handled 0.0/16 addresses. [RT #19716] --- diff --git a/CHANGES b/CHANGES index 0335b120494..afe10d2197b 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 c0d1161d663..8247749ad06 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.14.18.3 2005/04/29 00:16:46 marka Exp $"; + "$Id: inet_ntop.c,v 1.14.18.4 2009/07/18 21:13:55 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);