Fixes CIDR calculation

Closes-Bug: #1254818

Change-Id: Ida91d78f6a09489fd3bcbdbdd0d256b8b49e5363