Skip to content

Commit

Permalink
send empty SERVFAIL after a backend throws a DBException
Browse files Browse the repository at this point in the history
  • Loading branch information
mind04 committed Sep 23, 2014
1 parent 65d3cb2 commit 25e7af3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pdns/packethandler.cc
Expand Up @@ -1317,6 +1317,8 @@ DNSPacket *PacketHandler::questionOrRecurse(DNSPacket *p, bool *shouldRecurse)
}
catch(DBException &e) {
L<<Logger::Error<<"Backend reported condition which prevented lookup ("+e.reason+") sending out servfail"<<endl;
delete r;
r=p->replyPacket(); // generate an empty reply packet
r->setRcode(RCode::ServFail);
S.inc("servfail-packets");
S.ringAccount("servfail-queries",p->qdomain);
Expand All @@ -1328,7 +1330,7 @@ DNSPacket *PacketHandler::questionOrRecurse(DNSPacket *p, bool *shouldRecurse)
catch(std::exception &e) {
L<<Logger::Error<<"Exception building answer packet ("<<e.what()<<") sending out servfail"<<endl;
delete r;
r=p->replyPacket(); // generate an empty reply packet
r=p->replyPacket(); // generate an empty reply packet
r->setRcode(RCode::ServFail);
S.inc("servfail-packets");
S.ringAccount("servfail-queries",p->qdomain);
Expand Down

0 comments on commit 25e7af3

Please sign in to comment.