mirror of
https://github.com/hickory-dns/hickory-dns.git
synced 2026-04-25 03:05:51 +03:00
[PR #728] [MERGED] Generate meaningfull EdnsCodes from EdnsOptions #1637
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#1637
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?
📋 Pull Request Information
Original PR: https://github.com/hickory-dns/hickory-dns/pull/728
Author: @jonasbb
Created: 4/5/2019
Status: ✅ Merged
Merged: 4/5/2019
Merged by: @bluejekyll
Base:
master← Head:fix-ednscode-from-ednsoption📝 Commits (1)
54acc35Generate meaningfull EdnsCodes from EdnsOptions📊 Changes
1 file changed (+1 additions, -1 deletions)
View changed files
📝
crates/proto/src/rr/rdata/opt.rs(+1 -1)📄 Description
My use case is setting and potentially overwriting EDNS options in parsed Messages.
This is an example for an EDNS section:
And here is how I try to modify the Padding option:
This is the result before my patch. Notice how there are two padding entries, but with the two different keys of
EdnsCode::PaddingandEdnsCode::Unknown(12).This is what I want to get and what happens with this PR merged:
Before this commit the
From<&'a EdnsOption> for EdnsCodeimplementationalways created
Ednscode::Unknownentries. This is a problem, because theOPTtype is keyed by anEdnsCodevalue, butEdnsCode::Unknown(12)andEdnsCode::Paddingare not compared as equal.This change improves the situation by always creating the meaningfull
EdnsCodevariants instead ofEdnsCode::Unknown.I don't know if this fully fixes the problem. While
EdnsCode::Unknown(12)andEdnsCode::Paddingare differently structured they should probably compare as equal, since they logically represent the same thing. So it might be necessary to change theEqimplementation to ensure thatEdnsCode::Padding == EdnsCode::Unknown(12)is true.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.