]> git.ipfire.org Git - thirdparty/pdns.git/commit
dnsdist: Fix getEDNSOptions() for {AN,NS}COUNT != 0 and ARCOUNT = 0 9542/head
authorRemi Gacogne <remi.gacogne@powerdns.com>
Wed, 23 Sep 2020 08:02:15 +0000 (10:02 +0200)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Mon, 28 Sep 2020 10:42:00 +0000 (12:42 +0200)
commitf3392de780f661b21a11616972703a6984d84fd0
tree1740540714ecd989e4302d03342c767dee1bb57b
parent1ddff83b41c05cf7b7a0897faee6a360b5ab955f
dnsdist: Fix getEDNSOptions() for {AN,NS}COUNT != 0 and ARCOUNT = 0

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 38af359d79bccc500deaa598957a1b0d1ce11fd4)
pdns/dnsdist-ecs.cc
pdns/test-dnsdist_cc.cc