From f1ad3c5bc3187350d8345f793bcb59d10e9c7d27 Mon Sep 17 00:00:00 2001 From: Aki Tuomi Date: Fri, 26 Sep 2014 14:24:58 +0300 Subject: [PATCH] Make sure we send servfail on error --- pdns/distributor.hh | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/pdns/distributor.hh b/pdns/distributor.hh index 6235ec0f6..cf8e56d8b 100644 --- a/pdns/distributor.hh +++ b/pdns/distributor.hh @@ -218,7 +218,7 @@ templatevoid *MultiThreadDistributo us->d_overloaded=false; } - Answer *a; + Answer *a; #ifndef SMTPREDIR if(queuetimeout && q->d_dt.udiff()>queuetimeout*1000) { @@ -235,12 +235,18 @@ templatevoid *MultiThreadDistributo catch(const PDNSException &e) { L<replyPacket(); + a->setRcode(RCode::ServFail); + S.inc("servfail-packets"); + S.ringAccount("servfail-queries",q->qdomain); } catch(...) { L<replyPacket(); + a->setRcode(RCode::ServFail); + S.inc("servfail-packets"); + S.ringAccount("servfail-queries",q->qdomain); } AnswerData AD; @@ -270,13 +276,19 @@ templateint SingleThreadDistributor L<replyPacket(); + a->setRcode(RCode::ServFail); + S.inc("servfail-packets"); + S.ringAccount("servfail-queries",q->qdomain); } catch(...) { L<replyPacket(); + a->setRcode(RCode::ServFail); + S.inc("servfail-packets"); + S.ringAccount("servfail-queries",q->qdomain); } AnswerData AD; AD.A=a; -- 2.40.0