Remove modulus from percentage calculation

Instead take the last part of ip, divide by 256 to get percentage and compare to percentage passed in.

//cc @remy