diff --git a/source/extensions/filters/udp/dns_filter/dns_filter.cc b/source/extensions/filters/udp/dns_filter/dns_filter.cc index dc4c8bc30820..a287246e1e9f 100644 --- a/source/extensions/filters/udp/dns_filter/dns_filter.cc +++ b/source/extensions/filters/udp/dns_filter/dns_filter.cc @@ -19,7 +19,8 @@ DnsFilterEnvoyConfig::DnsFilterEnvoyConfig( Server::Configuration::ListenerFactoryContext& context, const envoy::extensions::filters::udp::dns_filter::v3alpha::DnsFilterConfig& config) : root_scope_(context.scope()), cluster_manager_(context.clusterManager()), api_(context.api()), - stats_(generateStats(config.stat_prefix(), root_scope_)), random_(context.random()) { + stats_(generateStats(config.stat_prefix(), root_scope_)), + resolver_timeout_(DEFAULT_RESOLVER_TIMEOUT), random_(context.random()) { using envoy::extensions::filters::udp::dns_filter::v3alpha::DnsFilterConfig; const auto& server_config = config.server_config(); diff --git a/source/extensions/filters/udp/dns_filter/dns_filter_resolver.h b/source/extensions/filters/udp/dns_filter/dns_filter_resolver.h index ee499683db76..23372871a618 100644 --- a/source/extensions/filters/udp/dns_filter/dns_filter_resolver.h +++ b/source/extensions/filters/udp/dns_filter/dns_filter_resolver.h @@ -21,9 +21,9 @@ class DnsFilterResolver : Logger::Loggable { DnsFilterResolver(DnsFilterResolverCallback& callback, AddressConstPtrVec resolvers, std::chrono::milliseconds timeout, Event::Dispatcher& dispatcher, uint64_t max_pending_lookups) - : dispatcher_(dispatcher), + : timeout_(timeout), dispatcher_(dispatcher), resolver_(dispatcher.createDnsResolver(resolvers, false /* use_tcp_for_dns_lookups */)), - callback_(callback), timeout_(timeout), max_pending_lookups_(max_pending_lookups) {} + callback_(callback), max_pending_lookups_(max_pending_lookups) {} /** * @brief entry point to resolve the name in a DnsQueryRecord * @@ -61,10 +61,10 @@ class DnsFilterResolver : Logger::Loggable { */ void onResolveTimeout(); + std::chrono::milliseconds timeout_; Event::Dispatcher& dispatcher_; const Network::DnsResolverSharedPtr resolver_; DnsFilterResolverCallback& callback_; - std::chrono::milliseconds timeout_; absl::flat_hash_map lookups_; uint64_t max_pending_lookups_; };