mirror of
https://github.com/hickory-dns/hickory-dns.git
synced 2026-04-25 03:05:51 +03:00
[PR #2487] [MERGED] Add resolver/recursor configuration to avoid udp ports #3081
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#3081
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/2487
Author: @divergentdave
Created: 10/1/2024
Status: ✅ Merged
Merged: 10/4/2024
Merged by: @djc
Base:
main← Head:david/avoid-udp-ports📝 Commits (6)
12db441Update documentation and commentsecd4956Add builder for UdpClientStream3da1cd7Use new builder63b1cb8Remove existing constructors1579cd4Add avoid_local_port option to UDP client stream445eeeeAdd avoid_local_udp_ports to recursor config📊 Changes
17 files changed (+184 additions, -163 deletions)
View changed files
📝
bin/benches/comparison_benches.rs(+4 -4)📝
bin/tests/integration/named_tests.rs(+2 -2)📝
crates/client/src/udp/udp_client_connection.rs(+5 -7)📝
crates/proto/src/tests/udp.rs(+4 -1)📝
crates/proto/src/udp/udp_client_stream.rs(+76 -103)📝
crates/proto/src/udp/udp_stream.rs(+48 -20)📝
crates/recursor/src/recursor.rs(+12 -1)📝
crates/recursor/src/recursor_dns_handle.rs(+9 -5)📝
crates/resolver/Cargo.toml(+1 -1)📝
crates/resolver/src/config.rs(+5 -3)📝
crates/resolver/src/name_server/connection_provider.rs(+4 -6)📝
crates/server/src/store/recursor/authority.rs(+1 -0)📝
crates/server/src/store/recursor/config.rs(+5 -0)📝
tests/integration-tests/tests/integration/client_future_tests.rs(+5 -7)📝
tests/integration-tests/tests/integration/dnssec_client_handle_tests.rs(+1 -1)📝
tests/integration-tests/tests/integration/truncation_tests.rs(+1 -1)📝
util/src/bin/dns.rs(+1 -1)📄 Description
This addresses #1722 for UDP sockets by adding configuration options to avoid binding to a list of local UDP ports. I added a builder for
UdpClientStreamto clean up the existing constructors, and add the ability to pass on this new configuration. (note that two of the existing constructors were identical save for argument order) I put the list of ports to avoid in anArcfromResolverOptsand onward, to avoid cloningHashSets after startup.I manually tested this by adding a bias to the random port selection and extra logging statements, and confirming that the new rejection sampling loop kicked in.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.