Commit f78603b5 authored by Witold Krecicki's avatar Witold Krecicki
Browse files

[master] Fix a minor bug in isc_netaddr_masktoprefixlen

parent 03bb19ed
...@@ -57,7 +57,7 @@ isc_result_t ...@@ -57,7 +57,7 @@ isc_result_t
isc_netaddr_masktoprefixlen(const isc_netaddr_t *s, unsigned int *lenp); isc_netaddr_masktoprefixlen(const isc_netaddr_t *s, unsigned int *lenp);
/*%< /*%<
* Convert a netmask in 's' into a prefix length in '*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. * most significant part of the address, followed by '0' bits.
* If this is not the case, #ISC_R_MASKNONCONTIG is returned. * If this is not the case, #ISC_R_MASKNONCONTIG is returned.
* *
......
...@@ -270,7 +270,6 @@ isc_netaddr_masktoprefixlen(const isc_netaddr_t *s, unsigned int *lenp) { ...@@ -270,7 +270,6 @@ isc_netaddr_masktoprefixlen(const isc_netaddr_t *s, unsigned int *lenp) {
for (; i < ipbytes; i++) { for (; i < ipbytes; i++) {
if (p[i] != 0) if (p[i] != 0)
return (ISC_R_MASKNONCONTIG); return (ISC_R_MASKNONCONTIG);
i++;
} }
*lenp = nbytes * 8 + nbits; *lenp = nbytes * 8 + nbits;
return (ISC_R_SUCCESS); return (ISC_R_SUCCESS);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment