mirror of
https://github.com/hickory-dns/hickory-dns.git
synced 2026-04-25 03:05:51 +03:00
[GH-ISSUE #2110] AsyncResolver mode , override RuntimeProvider , if take a little time in function bind_udp , so this function will be called many times repeatedly #890
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#890
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?
Originally created by @oujl on GitHub (Dec 12, 2023).
Original GitHub issue: https://github.com/hickory-dns/hickory-dns/issues/2110
Describe the bug
I am developing an Android app that uses Hickory DNS. I need to handle the fd special after the UDP socket in DNS. I overloaded the RuntimeProvider, and then I found that it caused a lot of UDP sockets to be created
To Reproduce
override RuntimeProvider , take a little time in function bind_udp , so this function will be called many times repeatedly
Expected behavior
A clear and concise description of what you expected to happen.
System:
Version:
Crate: [resolver]
Version: [0.24.0]
Additional context
Add any other context about the problem here.
@oujl commented on GitHub (Dec 12, 2023):
test code like this :
impl RuntimeProvider for XXXRuntimeProvider {
type Handle = TokioHandle;
type Timer = TokioTime;
type Udp = TokioUdpSocket;
type Tcp = AsyncIoTokioAsStd;
@djc commented on GitHub (Dec 12, 2023):
Yes, it creates a lot of UDP sockets, and for good reason (it would otherwise be too easy for a MITM attack to spoof DNS responses). Given that you didn't fill out the "Expected behavior" section it's unclear why this is causing an issue for you/what we should do differently.
@oujl commented on GitHub (Dec 12, 2023):
I am writing a VPN type app. Internally, it is necessary to distinguish between proxy traffic and non proxy traffic. I need to label the sockets for proxy traffic before sending data. On Android, it is VpnService # protect Android and Native use local socket communication. Every time DNS resolve is executed, many UDP sockets are created Each socket fd needs to be passed to Android VpnService through the local socket Sometimes I can't handle it. So is there any other API that can avoid creating so many UDP sockets
@djc commented on GitHub (Dec 12, 2023):
IIRC there currently is not. Perhaps you can avoid relying on UDP in your configuration?
@oujl commented on GitHub (Dec 12, 2023):
OK。Thank you for your answer