Depending on the amount of IP's, searching a linear array isn't very effective either. So we could escalate this into either "use a hashmap" or "do binary search of sorted IP's"

How many IP's are supposed to be whitelisted?