Set the netmask and prefix lengths correctly