mirror of
https://github.com/hickory-dns/hickory-dns.git
synced 2026-04-25 11:15:54 +03:00
[GH-ISSUE #2723] Defer FORMERR when QDCOUNT=0 #1048
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#1048
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 @divergentdave on GitHub (Jan 14, 2025).
Original GitHub issue: https://github.com/hickory-dns/hickory-dns/issues/2723
Currently the unknown opcode tests from RFC 8906 are failing because of an unexpected RCODE of FORMERR (instead of NOTIMP). This is caused by the call to
Queries::try_into_query()when decoding aMessageRequest. We do not match on the opcode until later, insideCatalog's implementation ofRequestHandler.We should move this requirement that QDCOUNT=1 until later for a few reasons. First, it'll allow fixing this particular test failure. Secondly, different opcodes assign different meanings to the query section, so it is incorrect to treat QDCOUNT!=1 as a format error without considering the opcode as well. Third, even when OPCODE=0 (for QUERY), there are situations where we may see QDCOUNT=0. For example, RFC 7873, DNS Cookies, says that clients may prefetch a cookie by making a query with OPCODE=0, QDCOUNT=0, and an OPT pseudo-record with a COOKIE option. (note that we don't fully support COOKIE now, but I think it would be good to do so in the future. See #2075)
According to RFC 9619, we can expect that QDCOUNT will not be greater than 1 for OPCODE=0. The same may not hold for other opcodes.
The assumption that there is exactly one query is embedded in the
MessageRequeststruct, which contains aWireQuery, and in turn aQuery. I think we'll have to replace this with aQueriesfield, and reshuffle related accessors. For example, we could move theQueries::try_into_query()call into a fallible method, and then only call that after we have matched on the opcode.