mirror of
https://github.com/hickory-dns/hickory-dns.git
synced 2026-04-25 11:15:54 +03:00
[GH-ISSUE #1179] Name compression failures on corner cases #623
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#623
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 @jacoblin1994 on GitHub (Aug 3, 2020).
Original GitHub issue: https://github.com/hickory-dns/hickory-dns/issues/1179
Describe the bug
Name compression seems to fail on some corner cases, in this case, 'frontdoor.nest.com.' followed by several of its answer records 'frontdoor-srt01-production-1909587911.us-east-1.elb.amazonaws.com.' Strangely enough, if you swap the order presented to BinEncoder such that 'frontdoor.nest.com.' is placed at the end, the compression seems to be done correctly as expected.
To Reproduce
trust-dns/crates/proto/src/rr/domain/name.rs
Expected behavior
Expect Name/labels to be properly compressed but the result does not seem to suggest so.
Version:
Version: [0.7.3]
@bluejekyll commented on GitHub (Aug 4, 2020):
woh. 0.7? is there a reason you're using such an old version?
There were some label compression issues in earlier releases, but current versions should be working correctly.
@jacoblin1994 commented on GitHub (Aug 4, 2020):
Thank you, Benjamin, for the reply.
I also did the testing on the latest version 0.19.5 as well, which is failing as well. This compression method, emit_as_canonical, has been untouched for the past 3 years or so if I understand it correctly. Could you please confirm if you are able to compress appropriately on the above specific queries?
@bluejekyll commented on GitHub (Aug 4, 2020):
It’s been a while since I’ve looked at this. It’s quite possible the logic hasn’t changed in 3 years.
I haven’t spent a ton of time optimizing the label compression, so it wouldn’t surprise me if there are some improvements available in this area.
@bluejekyll commented on GitHub (Aug 4, 2020):
Looking at this a little more, I think the issue here is that we're not picking the best label compression option, only the first found. It feels like we should have two passes here rather than the single one that is happening today. Basically, search through all the labels, and look for the longest matching one.
@jacoblin1994 commented on GitHub (Aug 4, 2020):
It looks like trust-dns-proto does not support labels ending with a pointer compression as in encoder.trim(), the associated name_pointers get removed completely due to the new offset being set.
https://tools.ietf.org/html/rfc1035#section-4.1.4
@bluejekyll commented on GitHub (Aug 4, 2020):
That's definitely possible. Again, this needs to be optimized, and that hasn't happened. The code clarity in this area could be improved as well.
If you were interested in working on this, I'd definitely love the help.
@jacoblin1994 commented on GitHub (Aug 5, 2020):
Thanks Benjamin. Happy to help with this.
I do have a working patch that I still want to take some time polishing.
@jacoblin1994 commented on GitHub (Aug 6, 2020):
Hi Benjamin, could you please add me as a collaborator, so that I can make a pull request? Thanks.
@bluejekyll commented on GitHub (Aug 6, 2020):
Usually folks fork the repo in Github, and then submit PRs from their fork in Github, that doesn't require collaborator status: https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/creating-a-pull-request-from-a-fork
@jacoblin1994 commented on GitHub (Aug 6, 2020):
Sounds good. I will follow this. Thanks.