Migrate hickory_dns.rs to hickory-resolver/hickory-proto 0.26.1 API#138
Draft
Copilot wants to merge 4 commits into
Draft
Migrate hickory_dns.rs to hickory-resolver/hickory-proto 0.26.1 API#138Copilot wants to merge 4 commits into
Copilot wants to merge 4 commits into
Conversation
Fix RUSTSEC-2026-0118 and RUSTSEC-2026-0119 Signed-off-by: Ryan Northey <ryan@synca.io>
Agent-Logs-Url: https://github.com/phlax/envoy/sessions/364c9a74-8259-4bfc-9ce8-49636cab3dc1 Co-authored-by: phlax <454682+phlax@users.noreply.github.com>
…etails Agent-Logs-Url: https://github.com/phlax/envoy/sessions/364c9a74-8259-4bfc-9ce8-49636cab3dc1 Co-authored-by: phlax <454682+phlax@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix hickory_dns migration to 0.26 API
Migrate hickory_dns.rs to hickory-resolver/hickory-proto 0.26.1 API
May 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
After bumping
hickory-resolver/hickory-prototo 0.26.1 (RUSTSEC-2026-0118/0119),hickory_dns.rswas left on the old 0.25 API and fails to compile. This migrates all affected call sites to the 0.26 API with no behavior changes.API changes
TokioConnectionProviderremoved — provider type is nowTokioRuntimeProviderdirectly:NameServerConfigrestructured — no longer takesSocketAddr + Protocol; now takesIpAddr + Vec<ConnectionConfig>with port set on the connection:proto::xfer::Protocol— import dropped; protocol is now expressed viaConnectionConfigbuilder methods (::udp(),::tcp(),::tls(),::https())ResolverConfig::new()→ResolverConfig::default()ResolveError→hickory_resolver::net::NetErrorLookup::records()→Lookup::answers(); record fieldsdata/ttlare now public struct fields rather than getter methods; pattern matchRData::A/RData::AAAAdirectlyopts.cache_sizetype changedusize→u64builder.build()now returnsResult— unwrapped with the error included in the panic messageOriginal prompt
Context
PR envoyproxy#44858 bumps
hickory-proto/hickory-resolverto 0.26.1 to fix RUSTSEC-2026-0118 and RUSTSEC-2026-0119. The bump itself is correct, but the filesource/extensions/dynamic_modules/builtin_extensions/hickory_dns.rswas not migrated to the 0.26 API and CI fails to compile with:Goal
Update
source/extensions/dynamic_modules/builtin_extensions/hickory_dns.rsso it builds againsthickory-resolver/hickory-proto0.26.1, preserving existing behavior (system DNS, custom resolvers, DNS-over-TLS, DNS-over-HTTPS, DNSSEC, cache size, query timeout/tries, dual-stack lookups). No behavior changes other than what's required by the API.Required migration
1.
TokioConnectionProviderremovedIn 0.26 the connection provider is generic; the Tokio runtime provider lives at
hickory_resolver::proto::runtime::TokioRuntimeProviderand must be wrapped inhickory_resolver::name_server::GenericConnector. Investigate the exact location/spelling in 0.26.1 (it may also be re-exported as aTokioConnectionProvidertype alias in some patch versions — confirm against the actual 0.26.1 docs before choosing).The current type alias:
needs to become something like:
And construction in
build_resolver()(currentlylet provider = TokioConnectionProvider::default();) needs to be updated accordingly, e.g.:2.
proto::xfer::Protocolmoveduse hickory_resolver::proto::xfer::Protocol;no longer compiles. In 0.26Protocolis reachable viahickory_resolver::config::Protocol(orhickory_resolver::proto::Protocol). Update the import. AllProtocol::Udp | Tcp | Tls | Httpsusages should remain valid.3. Verify other 0.26 API surface used in this file still works
While editing, please double-check (and adapt if necessary) the following call sites against 0.26.1:
NameServerConfig::new(socket_addr, Protocol::Udp/Tcp/Tls/Https)— signature/fields. Confirmtls_dns_name: Option<String>andhttp_endpoint: Option<String>field names still exist; if renamed, update accordingly.ResolverConfig::new(),ResolverConfig::default(),add_name_server.ResolverOptsfields used:timeout,attempts,cache_size,validate.hickory_resolver::Resolver::builder_with_config(...).options_mut() = opts; .build()flow.resolver.lookup(name, RecordType::A/AAAA)returningResult<Lookup, ResolveError>andrecord.data().as_a()/as_aaaa().system_conf::read_system_conf().resolver.clear_cache()forreset_networking.If any of these have been renamed/restructured in 0.26.1, update to the equivalent API. Do not change behavior beyond what the new API requires.
Constraints
HickoryDnsResolverImpl,DnsResolverConfig/DnsResolverInstance/DnsActiveQueryimpls, declared init functions) unchanged.unsafe/Send + Syncassertions.cargo check/cargo buildfor the dynamic modules crate locally if possible to validate the fix.Files likely to change
source/extensions/dynamic_modules/builtin_extensions/hickory_dns.rs(No test file changes are expected — but if there are companion tests that import the same removed paths, fix them too.)
Acceptance
This pull request was created from Copilot chat.