Test IP address with mask