Abstract cidr comparison into common function

And use it for v4 / v6 CIDRs!