]> granicus.if.org Git - pdns/commitdiff
rec: Remove pdns.PASS and pdns.TRUNCATE
authorRemi Gacogne <remi.gacogne@powerdns.com>
Wed, 27 Sep 2017 14:24:39 +0000 (16:24 +0200)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Mon, 13 Nov 2017 15:20:04 +0000 (16:20 +0100)
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
pdns/pdns_recursor.cc

index e0120edfa144edaabf528205cc52b22dec1c6c83..c73951a585f7c424a97daeac6923293a509fc94e 100644 (file)
@@ -478,8 +478,7 @@ RecursorLua4::RecursorLua4(const std::string& fname)
     });
   typedef vector<pair<string, int> > in_t;
   vector<pair<string, boost::variant<int, in_t, struct timeval* > > >  pd{
-    {"PASS", (int)PolicyDecision::PASS}, {"DROP",  (int)PolicyDecision::DROP},
-    {"TRUNCATE", (int)PolicyDecision::TRUNCATE}
+    {"DROP",  (int)PolicyDecision::DROP}
   };
 
   vector<pair<string, int> > rcodes = {{"NOERROR",  RCode::NoError  },
index 4efc81e486900f28c492d55f906ba1527c27390b..183f9d32353cda778a3e9c0ec18c4edbff7fabcd 100644 (file)
@@ -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++;