From: Witold Krecicki Date: Fri, 23 Sep 2016 12:56:53 +0000 (+0200) Subject: [master] Fix a minor bug in isc_netaddr_masktoprefixlen X-Git-Tag: v9.12.0a1~761 X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=f78603b534bf51c661d975e6c398bc3326da17bd;p=thirdparty%2Fbind9.git [master] Fix a minor bug in isc_netaddr_masktoprefixlen --- diff --git a/lib/isc/include/isc/netaddr.h b/lib/isc/include/isc/netaddr.h index 43ad383f41d..4e341f763d2 100644 --- a/lib/isc/include/isc/netaddr.h +++ b/lib/isc/include/isc/netaddr.h @@ -57,7 +57,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 7dfc7a8dcc5..65779d39781 100644 --- a/lib/isc/netaddr.c +++ b/lib/isc/netaddr.c @@ -270,7 +270,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);