From 067fbdf2ecac819443b1f3cf431671ba6f2897fe Mon Sep 17 00:00:00 2001 From: Remi Gacogne Date: Wed, 27 Sep 2017 16:24:39 +0200 Subject: [PATCH] rec: Remove pdns.PASS and pdns.TRUNCATE Those values are not documented in a recursor context, and does not work as expected since `pdns.PASS` resulted in an immediate `ServFail` and `pdns.TRUNCATE` in a strange status code being sent (showing up as `RESERVED13` in `dig`). (cherry picked from commit 9cdfab64ac1750ac234a5b5efa4eba6cabc30257) --- pdns/lua-recursor4.cc | 3 +-- pdns/pdns_recursor.cc | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/pdns/lua-recursor4.cc b/pdns/lua-recursor4.cc index e0120edfa..c73951a58 100644 --- a/pdns/lua-recursor4.cc +++ b/pdns/lua-recursor4.cc @@ -478,8 +478,7 @@ RecursorLua4::RecursorLua4(const std::string& fname) }); typedef vector > in_t; vector > > pd{ - {"PASS", (int)PolicyDecision::PASS}, {"DROP", (int)PolicyDecision::DROP}, - {"TRUNCATE", (int)PolicyDecision::TRUNCATE} + {"DROP", (int)PolicyDecision::DROP} }; vector > rcodes = {{"NOERROR", RCode::NoError }, diff --git a/pdns/pdns_recursor.cc b/pdns/pdns_recursor.cc index 4efc81e48..183f9d323 100644 --- a/pdns/pdns_recursor.cc +++ b/pdns/pdns_recursor.cc @@ -978,7 +978,7 @@ void startDoResolve(void *p) dc=0; return; } - if(tracedQuery || res == PolicyDecision::PASS || res == RCode::ServFail || pw.getHeader()->rcode == RCode::ServFail) + if(tracedQuery || res == -1 || res == RCode::ServFail || pw.getHeader()->rcode == RCode::ServFail) { string trace(sr.getTrace()); if(!trace.empty()) { @@ -991,7 +991,7 @@ void startDoResolve(void *p) } } - if(res == PolicyDecision::PASS) { // XXX what does this MEAN? Why servfail on PASS? + if(res == -1) { pw.getHeader()->rcode=RCode::ServFail; // no commit here, because no record g_stats.servFails++; -- 2.40.0