From f8e3534f18b91f68b7c63cbcb8df1af95fd0fddc Mon Sep 17 00:00:00 2001 From: Witold Krecicki Date: Fri, 23 Sep 2016 14:56:53 +0200 Subject: [PATCH] [master] Fix a minor bug in isc_netaddr_masktoprefixlen (cherry picked from commit f78603b534bf51c661d975e6c398bc3326da17bd) --- lib/isc/include/isc/netaddr.h | 2 +- lib/isc/netaddr.c | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/isc/include/isc/netaddr.h b/lib/isc/include/isc/netaddr.h index 140d11826d..c73923bc8d 100644 --- a/lib/isc/include/isc/netaddr.h +++ b/lib/isc/include/isc/netaddr.h @@ -66,7 +66,7 @@ isc_result_t isc_netaddr_masktoprefixlen(const isc_netaddr_t *s, unsigned int *lenp); /*%< * Convert a netmask in 's' into a prefix length in '*lenp'. - * The mask should consist of zero or more '1' bits in the most + * The mask should consist of zero or more '1' bits in the * most significant part of the address, followed by '0' bits. * If this is not the case, #ISC_R_MASKNONCONTIG is returned. * diff --git a/lib/isc/netaddr.c b/lib/isc/netaddr.c index 2178c7a2a7..10749af206 100644 --- a/lib/isc/netaddr.c +++ b/lib/isc/netaddr.c @@ -279,7 +279,6 @@ isc_netaddr_masktoprefixlen(const isc_netaddr_t *s, unsigned int *lenp) { for (; i < ipbytes; i++) { if (p[i] != 0) return (ISC_R_MASKNONCONTIG); - i++; } *lenp = nbytes * 8 + nbits; return (ISC_R_SUCCESS);