check if IP is within the mask