Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pre-decompressed DNS record RData that may contain compression pointers #9311

Merged
merged 4 commits into from Jul 2, 2019

Conversation

qeesung
Copy link
Contributor

@qeesung qeesung commented Jul 1, 2019

Motivation:

When decoding DnsRecord, if the record contains compression pointers, and not all compression pointers are decompressed, but part of the pointers are decompressed. Then when encoding the record, the compressed pointer will point to the wrong location, resulting in bad label problem.

Modification:

Pre-decompressed record RData that may contain compression pointers.

Result:

Fixes #8962

@netty-bot
Copy link

Can one of the admins verify this patch?

@normanmaurer
Copy link
Member

@netty-bot test this please

Copy link
Member

@normanmaurer normanmaurer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two more nits then we are good to go... thanks a lot!

ByteBuf buffer = Unpooled.wrappedBuffer(compressionPointer);
ByteBuf uncomporessed = null;
try {
uncomporessed = DnsCodecUtil.decompressDomainName(buffer.duplicate().setIndex(10, 12));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: typo... should be "uncompressed"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@normanmaurer
Copy link
Member

@netty-bot test this please

@normanmaurer normanmaurer merged commit 18e4121 into netty:4.1 Jul 2, 2019
@normanmaurer
Copy link
Member

@qeesung thanks a lot!

normanmaurer pushed a commit that referenced this pull request Jul 2, 2019
…rs (#9311)

Motivation:

When decoding DnsRecord, if the record contains compression pointers, and not all compression pointers are decompressed, but part of the pointers are decompressed. Then when encoding the record, the compressed pointer will point to the wrong location, resulting in bad label problem.

Modification:

Pre-decompressed record RData that may contain compression pointers.

Result:

Fixes #8962
@normanmaurer normanmaurer added this to the 4.1.38.Final milestone Jul 2, 2019
@qeesung qeesung deleted the bad_dns_label branch July 3, 2019 01:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

netty-resolver-dns "Got bad packet: bad label type"
3 participants