[PR #2420] [MERGED] Ignore escaped dots when determining FQDN status #3031

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

📋 Pull Request Information

Original PR: https://github.com/hickory-dns/hickory-dns/pull/2420
Author: @divergentdave
Created: 9/5/2024
Status: Merged
Merged: 9/5/2024
Merged by: @djc

Base: mainHead: david/fqdn-ignore-escaped-dot


📝 Commits (1)

  • e800e5c Ignore escaped dots when determining FQDN status

📊 Changes

1 file changed (+17 additions, -1 deletions)

View changed files

📝 crates/proto/src/rr/domain/name.rs (+17 -1)

📄 Description

This fixes another oddity I noticed while reducing a test case for #2419. If a name ends with \., then Name::from_encoded_str() both adds a dot to the last label, due to escape decoding rules, and sets the flag that the name is an FQDN, because that check is unaware of escapes. As a result, encoding the name again will produce an extra dot at the end. This PR fixes the check by instead looking at whether the label local variable has just been cleared.


🔄 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/2420 **Author:** [@divergentdave](https://github.com/divergentdave) **Created:** 9/5/2024 **Status:** ✅ Merged **Merged:** 9/5/2024 **Merged by:** [@djc](https://github.com/djc) **Base:** `main` ← **Head:** `david/fqdn-ignore-escaped-dot` --- ### 📝 Commits (1) - [`e800e5c`](https://github.com/hickory-dns/hickory-dns/commit/e800e5cb96c54742952994348aedb64418e9f692) Ignore escaped dots when determining FQDN status ### 📊 Changes **1 file changed** (+17 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `crates/proto/src/rr/domain/name.rs` (+17 -1) </details> ### 📄 Description This fixes another oddity I noticed while reducing a test case for #2419. If a name ends with `\.`, then `Name::from_encoded_str()` both adds a dot to the last label, due to escape decoding rules, and sets the flag that the name is an FQDN, because that check is unaware of escapes. As a result, encoding the name again will produce an extra dot at the end. This PR fixes the check by instead looking at whether the `label` local variable has just been cleared. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-16 11:21:29 +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#3031
No description provided.