Check an IP(v4 or v6) against a subnet.