]> git.ipfire.org Git - thirdparty/pdns.git/commit
Change the way RD=0 forwarded queries are handled. 12425/head
authorOtto Moerbeek <otto.moerbeek@open-xchange.com>
Tue, 17 Jan 2023 09:00:30 +0000 (10:00 +0100)
committerOtto Moerbeek <otto.moerbeek@open-xchange.com>
Tue, 17 Jan 2023 09:36:42 +0000 (10:36 +0100)
commit6af67958da24b34cd59c5761cfc98dd02cfb6bc6
treef577230b9cb6105861a98d5553b3209d153099ab
parent0374651be738a8d46495da56c3e812b136b46a64
Change the way RD=0 forwarded queries are handled.

Since forever, there has been special case code for forwarded queries
in the RD=0 case.  This special case code does a hardcoded RD=0
query to the specified forwarder.  This code has two consequences:

1. Even if the forwarder is marked recursive it gets a RD=0 query
2. The cache is not consulted at all

The corresponding unit tests actually test this behaviour, but after
historic digging with help from @rgacogne it turns out the the unit
test do not reflect the desired functionality, but the current state
of affairs to help with a refactoring PR.  That is good, since
refactoring should not change functionality.

But now the time has come to change the code to do the desired thing:

1. If an RD=0 query is received, do a cache only-lookup in all cases.
2. Never send a RD=0 query to a recursive forwarder

I already did a similar thing when I wrote the QName Minimization
code, introducing a conditional that only gets set for that case,
to avoid changing unrelated (to QM) functionality.
pdns/recursordist/syncres.cc
pdns/recursordist/syncres.hh
pdns/recursordist/test-syncres_cc3.cc