mirror of
https://github.com/hickory-dns/hickory-dns.git
synced 2026-04-25 19:25:56 +03:00
[GH-ISSUE #2816] proto-error trying to send dns updates with 0.25 #1068
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#1068
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 @jcgruenhage on GitHub (Mar 1, 2025).
Original GitHub issue: https://github.com/hickory-dns/hickory-dns/issues/2816
Describe the bug
I'm trying to send DNS update requests as part of a dyndns daemon. This used to work with 0.24, but fails on 0.25. On 0.25, it technically "works" as well, as in, sending the updates works, but parsing the responses fails with "proto error".
I can provide TCP dumps, and the ~70 lines of relevant code calling hickory-dns functions in my code are in
git.jcg.re/jcgruenhage/dyndnsd@f6608da7f4/src/dns.rs (L123-L187)To Reproduce
Call
ClientHandle::delete_rrset. Assuming the permissions etc are correct, I'd assume to get a successful response back. The pcap looks like this is the case.hickoryfails to come to the same conclusion, and instead returnsproto error.Expected behavior
I'd expect the response to be parsed in a way that comes to the conclusion that the update was successful. The change from the update message is applied, I can't see in the tcpdump why it wouldn't be considered that either.
System:
Version:
Crate: client / proto
Version:
c141df9468Additional context
The DNS server on the other side is
knotd, Knot DNS 3.4.0. The full source code of the dyndns daemon I'm building is available ingit.jcg.re/jcgruenhage/dyndnsd@f6608da7f4. When I modify the code to ignore the responses I get back from the server, it just works.I've tried debugging this myself, but haven't gotten very far yet. If this is user error, I'd happily be told what I'm doing wrong.
@djc commented on GitHub (Mar 1, 2025):
Thanks for testing and for the detailed bug report!
Would be cool if you could just extract the response bytes you get from the server into a unit test as a PR.
@jcgruenhage commented on GitHub (Mar 1, 2025):
The response:
Does this help?
@djc commented on GitHub (Mar 1, 2025):
Yes, though it would make my life easier if you can stuff this into a PR as a unit test with a Rust array. Maybe you can parse it as a message to see how it fails?
@jcgruenhage commented on GitHub (Mar 1, 2025):
Just down in this module somewhere?
github.com/hickory-dns/hickory-dns@cda2c38fd4/crates/proto/src/op/message.rs (L1124)@djc commented on GitHub (Mar 1, 2025):
Yup, let's start with that!
@jcgruenhage commented on GitHub (Mar 1, 2025):
Will push a PR with the message.
@jcgruenhage commented on GitHub (Mar 2, 2025):
I've bisected to figure out which commit introduced the breakage, and it's
c8691c8c2d, hope that helps. I've looked at the change a bit but don't see where the bug comes from.@jcgruenhage commented on GitHub (Mar 2, 2025):
I've asked ChatGPT about the changes in that commit and my testcase, and it told me that I have to remove the TCP/IP headers, and the first two bytes from the DNS data that indicates the length, because they're not part of the message. With both of these removed from my test case, it's parsed as a message successfully. Doesn't change that my dyndns daemon is still exhibiting the same problem where I'm getting back a proto error though.
@djc commented on GitHub (Mar 2, 2025):
Ahh, that's good to know, so I guess it means the problem might not be in the message parsing itself, but at a different level.
From your original application context, do you have the exact
ProtoErrorcontents?@jcgruenhage commented on GitHub (Mar 2, 2025):
I'll restructure my error handling to get more details out of it. so far anyhow is giving me the context, but not the details of the error itself:
@djc commented on GitHub (Mar 2, 2025):
Maybe also try if you can get the backtrace feature enabled and see what extra data that gives you.
@jcgruenhage commented on GitHub (Mar 2, 2025):
gives me
which is probably already enough context, right?
If any additional context is required (the whole request/response exchange, tsig keys, server configuration, anything), I'm happy to provide that.
@djc commented on GitHub (Mar 2, 2025):
Okay, so that's coming from here:
https://github.com/hickory-dns/hickory-dns/blob/main/crates/proto/src/dnssec/tsig.rs#L142
I'm guessing the
record.name()toself.0.signer_namecomparison has been thrown off by the FQDN adjustments from #2560. Can you have a look at what these values are in your test case?@jcgruenhage commented on GitHub (Mar 2, 2025):
Seems you're right in your suspicion.
@jcgruenhage commented on GitHub (Mar 2, 2025):
Ftr: If I add a trailing dot in my config file for the key name, then it starts to just work as expected.