diff --git a/src/context.rs b/src/context.rs index 13a5768b..db7f1d3c 100644 --- a/src/context.rs +++ b/src/context.rs @@ -311,21 +311,15 @@ impl Context { // Proxy everything by default None => true, Some(ref a) => { - // first check the IP list - if a.check_ip_in_proxy_list(ip) { - true + // do the reverse lookup in our local cache + let mut reverse_lookup_cache = self.reverse_lookup_cache.lock(); + // if a qname is found + if let Some(forward) = reverse_lookup_cache.get(ip) { + // if qname is resolved by remote, + // we should proxy it as well + *forward } else { - // do the reverse lookup in our local cache - let mut reverse_lookup_cache = self.reverse_lookup_cache.lock(); - // if a qname is found - if let Some(forward) = reverse_lookup_cache.get(ip) { - // if qname is resolved by remote, - // we should proxy it as well - *forward - } else { - // by default not proxied - false - } + a.check_ip_in_proxy_list(ip) } } }