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

dnsdist-1.5.x: Fix getEDNSOptions() for {AN,NS}COUNT != 0 and ARCOUNT = 0 #9542

Merged

Conversation

rgacogne
Copy link
Member

@rgacogne rgacogne commented Sep 28, 2020

Short description

Backport of #9513 to dnsdist-1.5.x.

Since 1.5.0, calling getEDNSOptions() from Lua would result in a ServFail for queries that had no records in additional but at least one record in either the answer or authority section, such as a NOTIFY, because of a bug in parseEDNSOptions(). That last function incorrectly called slowParseEDNSOptions() in that case, triggering an exception to be raised because slowParseEDNSOptions() does not expect to be called for a packet with no record in the additional section.
parseEDNSOptions() now returns false for packets that have no record in the additional section.

(cherry picked from commit 38af359)

Checklist

I have:

  • read the CONTRIBUTING.md document
  • compiled this code
  • tested this code
  • included documentation (including possible behaviour changes)
  • documented the code
  • added or modified regression test(s)
  • added or modified unit test(s)
  • checked that this code was merged to master

@rgacogne rgacogne added this to the dnsdist-1.5.x milestone Sep 28, 2020
@rgacogne rgacogne changed the base branch from master to rel/dnsdist-1.5.x Sep 28, 2020
Since 1.5.0, calling getEDNSOptions() from Lua would result in a
ServFail for queries that had no records in additional but at least
one record in either the answer or authority section, such as a
NOTIFY, because of a bug in parseEDNSOptions(). That last function
incorrectly called slowParseEDNSOptions() in that case, triggering
an exception to be raised because slowParseEDNSOptions() does not
expect to be called for a packet with no record in the additional
section.
parseEDNSOptions() now returns `false` for packets that have no
record in the additional section.

(cherry picked from commit 38af359)
@rgacogne rgacogne force-pushed the ddist15-fix-parse-edns-options branch from e2f2465 to f3392de Compare Sep 28, 2020
@rgacogne rgacogne merged commit b6c051a into PowerDNS:rel/dnsdist-1.5.x Sep 28, 2020
4 checks passed
@rgacogne rgacogne deleted the ddist15-fix-parse-edns-options branch Sep 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant