mirror of
https://github.com/hickory-dns/hickory-dns.git
synced 2026-04-25 11:15:54 +03:00
[GH-ISSUE #2081] IPv6 UDP resolution doesn't work over link-local addresses #876
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#876
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 @orbekk on GitHub (Oct 29, 2023).
Original GitHub issue: https://github.com/hickory-dns/hickory-dns/issues/2081
Describe the bug
When querying a link-local DNS server over IPv6 UDP, the response is ignored because it's assigned a scope, which fails to match the original dns server requested by the resolver. I can reproduce this with the hickory dns server running locally, and dnsmasq running on my router.
It looks like linux assigns a scope whenever it's using a link-local address:
github.com/torvalds/linux@2af9b20dbb/include/net/ipv6.h (L571)Perhaps the scope should be ignored when matching the socket address?
To Reproduce
Steps to reproduce the behavior:
listen_addrs_ipv6 = ["::"].Expected behavior
It should return a result, like it does when querying a non-link local address:
System:
Version:
Crate: resolver
Version:
b0c0566483Additional context
Add any other context about the problem here.
@ReactorScram commented on GitHub (Jan 3, 2024):
Seeing the same problem on Windows 11 after enabling IPv6 on my home router. Might be that I'm passing the wrong IPs into hickory? 🤔
@bluejekyll commented on GitHub (Jan 3, 2024):
Thanks for tracking down the details on this. I think we need to do a comparison on the raw IP and port rather than the IpAddr. I was unaware of the change in Rust
1.69to start tracking these additional fields on the IpAddr. I'm guessing that if you compile with something pre1.69this issue will go away. I think I can get a patch ready for this today, it will likely impact all previous versions.This is the comparison that needs to be updated:
github.com/hickory-dns/hickory-dns@0d965da4b1/crates/proto/src/udp/udp_client_stream.rs (L333)@bluejekyll commented on GitHub (Jan 3, 2024):
I've published a patch which should fix this issue in #2124 if you want to experiment with seeing that it resolves this issue.
@bluejekyll commented on GitHub (Jan 4, 2024):
I'm realizing this could be responsible for a bunch of other IPv6 issues...
@orbekk commented on GitHub (Jan 4, 2024):
I gave it a try and it looks good. Left a comment in #2124 with the testing.
@djc commented on GitHub (Jan 4, 2024):
@bluejekyll did you track down the std changes for 1.69? What you're saying sounds kinda scary since I think most code would expect the
SocketAddrcomparisons to only involve IP and port...@bluejekyll commented on GitHub (Jan 5, 2024):
Oh, you know what, I’m misreading the docs. 1.69 is when it became const. Maybe we just haven’t had a lot of local IPv6 usage on windows or Linux and macOS doesn’t set these options? I’ll have to investigate those fields and how they’re set on the different OSs. By default they are zeroed out.