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

Make sure UDP DNS responses aren't larger than allowed #1813

Merged
merged 2 commits into from
Mar 9, 2016
Merged

Conversation

slackpad
Copy link
Contributor

@slackpad slackpad commented Mar 9, 2016

Took #1734 by @idubinskiy and made a few minor tweaks.

slackpad added a commit that referenced this pull request Mar 9, 2016
Makes sure UDP DNS responses aren't larger than allowed.
@slackpad slackpad merged commit e944b18 into master Mar 9, 2016
@slackpad slackpad deleted the f-dns-trim branch March 9, 2016 07:26
@idubinskiy
Copy link
Contributor

Thanks! Will this make it in for 0.6.4?

@slackpad
Copy link
Contributor Author

slackpad commented Mar 9, 2016

It should - I plan on merging it today,

if network != "tcp" && len(resp.Answer) > maxServiceResponses {
resp.Answer = resp.Answer[:maxServiceResponses]
if network != "tcp" {
wasTrimmed := trimAnswers(resp)
Copy link

Choose a reason for hiding this comment

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

@slackpad Apologies for bringing up an already merged PR, but it looks like this trimming is being done regardless of the enable_truncate setting. Shouldn't d.config.EnableTruncate be checked before trimAnswers() is called?

Copy link
Contributor

Choose a reason for hiding this comment

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

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.

3 participants