]> git.ipfire.org Git - thirdparty/pdns.git/commit
dnsdist: Fix getEDNSOptions() for {AN,NS}COUNT != 0 and ARCOUNT = 0 9513/head
authorRemi Gacogne <remi.gacogne@powerdns.com>
Wed, 23 Sep 2020 08:02:15 +0000 (10:02 +0200)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Wed, 23 Sep 2020 08:02:15 +0000 (10:02 +0200)
commit38af359d79bccc500deaa598957a1b0d1ce11fd4
tree80179942fd44b7f0a159074df255e13d4bb7f148
parent109c199dbd337405bdd25aad4fa6a8c419dc6fdb
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.
pdns/dnsdist-ecs.cc
pdns/test-dnsdist_cc.cc