[PR #744] [CLOSED] Do not fail on parsing an empty Option at the end of an EDNS record #1650

Closed
opened 2026-03-16 02:17:52 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/hickory-dns/hickory-dns/pull/744
Author: @jonasbb
Created: 4/9/2019
Status: Closed

Base: masterHead: fix-empty-option-at-end-of-edns


📝 Commits (2)

  • b9af6d6 Do not fail on parsing an empty Option within an EDNS record
  • 02f5755 Only use minimal feature set from futures

📊 Changes

2 files changed (+43 additions, -7 deletions)

View changed files

📝 crates/proto/Cargo.toml (+1 -1)
📝 crates/proto/src/rr/rdata/opt.rs (+42 -6)

📄 Description

The old implementation has trouble parsing an option with length 0 at
the end of the EDNS OPT record. The while loop parsing the data will end
in the OptReadState::Data state, but expects to read 0 additional
bytes. For this special condition, we can create the last option after
the loop.

I added a test case for parsing one such case. Here is a screenshot of wireshark parsing the DNS message:
Screenshot from 2019-04-08 16-15-20

It is unfortunate, that parsing succeeds, even though the code is not able to process all options correctly.


🔄 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/744 **Author:** [@jonasbb](https://github.com/jonasbb) **Created:** 4/9/2019 **Status:** ❌ Closed **Base:** `master` ← **Head:** `fix-empty-option-at-end-of-edns` --- ### 📝 Commits (2) - [`b9af6d6`](https://github.com/hickory-dns/hickory-dns/commit/b9af6d64c608c7b45f8d03af5e1a5c079699f9b1) Do not fail on parsing an empty Option within an EDNS record - [`02f5755`](https://github.com/hickory-dns/hickory-dns/commit/02f5755308a43bc5fe1e6c17dce213ca582539bf) Only use minimal feature set from futures ### 📊 Changes **2 files changed** (+43 additions, -7 deletions) <details> <summary>View changed files</summary> 📝 `crates/proto/Cargo.toml` (+1 -1) 📝 `crates/proto/src/rr/rdata/opt.rs` (+42 -6) </details> ### 📄 Description The old implementation has trouble parsing an option with length 0 at the end of the EDNS OPT record. The while loop parsing the data will end in the `OptReadState::Data` state, but expects to read 0 additional bytes. For this special condition, we can create the last option after the loop. I added a test case for parsing one such case. Here is a screenshot of wireshark parsing the DNS message: ![Screenshot from 2019-04-08 16-15-20](https://user-images.githubusercontent.com/273459/55784754-7dee6f00-5ab1-11e9-9744-6ab85681b36c.png) It is unfortunate, that parsing succeeds, even though the code is not able to process all options correctly. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-16 02:17:52 +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#1650
No description provided.