]> granicus.if.org Git - pdns/commit
dnsdist: Check the flags to detect collisions in the packet cache
authorRemi Gacogne <remi.gacogne@powerdns.com>
Thu, 21 Jun 2018 10:38:50 +0000 (12:38 +0200)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Fri, 22 Jun 2018 09:09:13 +0000 (11:09 +0200)
commit8dcdbdb11e711db9140afe3f3728f0a22b550101
tree4318db9603831dae59d13b1acbab3c66b5093992
parent9bb64785797d4b4829be3debc477458a7f81e7bd
dnsdist: Check the flags to detect collisions in the packet cache

In the unlikely but quite real event two queries with the same qname,
qtype and qclass but different EDNS options or flags end up with
the same hash, the packet cache would return a answer that might
not be suitable for the query. Reduce the odds by checking the
flags present in the dns header in addition to the qname, qtype
and qclass.
For the same reason we might need to consider storing the ECS
subnet if any.
pdns/dnsdist-cache.cc
pdns/dnsdist-cache.hh
pdns/dnsdist-tcp.cc
pdns/dnsdist.cc
pdns/test-dnsdistpacketcache_cc.cc