[PR #2729] [MERGED] server: defer FORMERR when QDCOUNT!=1 #3271

Closed
opened 2026-03-16 11:34:41 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/hickory-dns/hickory-dns/pull/2729
Author: @divergentdave
Created: 1/16/2025
Status: Merged
Merged: 1/21/2025
Merged by: @divergentdave

Base: mainHead: david/defer-qdcount-check


📝 Commits (1)

  • 26a9cb4 server: defer FORMERR when QDCOUNT!=1

📊 Changes

6 files changed (+98 additions, -126 deletions)

View changed files

📝 conformance/packages/conformance-tests/src/name_server/rfc8906/basic.rs (+0 -1)
📝 crates/server/src/authority/catalog.rs (+25 -8)
📝 crates/server/src/authority/message_request.rs (+23 -39)
📝 crates/server/src/authority/message_response.rs (+16 -54)
📝 crates/server/src/server/request_handler.rs (+8 -4)
📝 crates/server/src/server/server_future.rs (+26 -20)

📄 Description

This makes some changes to the server crate to more gracefully handle messages with zero queries, and let us return NOTIMP with a higher precedence in such cases if the opcode is unrecognized. Fixes #2723. In particular:

  • MessageRequest now contains a Queries instead of a WireQuery
    • Updated methods to reflect this change
    • Cleaned up helpers that are now dead code
  • MessageResponse and MessageResponseBuilder take &Queries instead of Option<&WireQuery>
  • Request::request_info() is now fallible
  • UpdateRequest::zone() is now fallible
  • Logging statements in server_future.rs were split in two to separately handle the case where QDCOUNT!=1 (and QNAME/QTYPE/QCLASS are not well defined)

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/hickory-dns/hickory-dns/pull/2729 **Author:** [@divergentdave](https://github.com/divergentdave) **Created:** 1/16/2025 **Status:** ✅ Merged **Merged:** 1/21/2025 **Merged by:** [@divergentdave](https://github.com/divergentdave) **Base:** `main` ← **Head:** `david/defer-qdcount-check` --- ### 📝 Commits (1) - [`26a9cb4`](https://github.com/hickory-dns/hickory-dns/commit/26a9cb4c74738b85cb46e9f500b8aff25b6e5271) server: defer FORMERR when QDCOUNT!=1 ### 📊 Changes **6 files changed** (+98 additions, -126 deletions) <details> <summary>View changed files</summary> 📝 `conformance/packages/conformance-tests/src/name_server/rfc8906/basic.rs` (+0 -1) 📝 `crates/server/src/authority/catalog.rs` (+25 -8) 📝 `crates/server/src/authority/message_request.rs` (+23 -39) 📝 `crates/server/src/authority/message_response.rs` (+16 -54) 📝 `crates/server/src/server/request_handler.rs` (+8 -4) 📝 `crates/server/src/server/server_future.rs` (+26 -20) </details> ### 📄 Description This makes some changes to the server crate to more gracefully handle messages with zero queries, and let us return `NOTIMP` with a higher precedence in such cases if the opcode is unrecognized. Fixes #2723. In particular: - `MessageRequest` now contains a `Queries` instead of a `WireQuery` - Updated methods to reflect this change - Cleaned up helpers that are now dead code - `MessageResponse` and `MessageResponseBuilder` take `&Queries` instead of `Option<&WireQuery>` - `Request::request_info()` is now fallible - `UpdateRequest::zone()` is now fallible - Logging statements in server_future.rs were split in two to separately handle the case where QDCOUNT!=1 (and QNAME/QTYPE/QCLASS are not well defined) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-16 11:34:41 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/hickory-dns#3271
No description provided.