mirror of
https://github.com/hickory-dns/hickory-dns.git
synced 2026-04-25 19:25:56 +03:00
[PR #3265] [MERGED] recursor: tidy up builder filters, recursor handle construction #3694
Labels
No labels
blocked
breaking-change
bug
bug:critical
bug:tests
cleanup
compliance
compliance
compliance
crate:all
crate:client
crate:native-tls
crate:proto
crate:recursor
crate:resolver
crate:resolver
crate:rustls
crate:server
crate:util
dependencies
docs
duplicate
easy
easy
enhance
enhance
enhance
feature:dns-over-https
feature:dns-over-quic
feature:dns-over-tls
feature:dnsssec
feature:global_lb
feature:mdns
feature:tsig
features:edns
has workaround
ops
perf
platform:WASM
platform:android
platform:fuchsia
platform:linux
platform:macos
platform:windows
pull-request
question
test
tools
tools
trust
unclear
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/hickory-dns#3694
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/hickory-dns/hickory-dns/pull/3265
Author: @cpu
Created: 9/5/2025
Status: ✅ Merged
Merged: 9/22/2025
Merged by: @cpu
Base:
main← Head:cpu-tidying-recursor-handle_dev📝 Commits (2)
4ea3470recursor: untangle recommended filters from additional ones1e6077erecursor: tidy up handle construction📊 Changes
4 files changed (+141 additions, -142 deletions)
View changed files
📝
crates/recursor/src/metrics_tests.rs(+1 -0)📝
crates/recursor/src/recursor.rs(+55 -90)📝
crates/recursor/src/recursor_dns_handle.rs(+83 -51)📝
crates/server/src/store/recursor.rs(+2 -1)📄 Description
First, untangle the default recommended filters from the builder method that allows extending the filters with additional IP networks. I bumped into this in the next commit when I was updating a unit test that previously side-stepped the builder that failed when I converted it to use it. The root cause was the surprising way that
RecursorBuilder::nameserver_filter()applied defaults in addition to the networks the user provides. See the commit message for more detail.Second, rejig the
RecursorDnsHandleconstruction to use theRecursorBuilderand return aRecursorMode. In practice, 98% of the arguments toRecursorDnsHandle::new()were coming directly from the builder, and then a few additional ones were used to build theRecursorMode. Instead, pass the whole builder into theRecursorDnsHandleand return theRecursorModethat wraps the constructed handle. This requires promoting some pieces ofrecursor.rstopub(super). Alternatively we could consider foldingrecursor_dns_handle.rsintorecursor.rssince they're so closely intertwined.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.