Skip to content

Commit

Permalink
limit NSEC3 iterations in bindbackend
Browse files Browse the repository at this point in the history
  • Loading branch information
mind04 committed Oct 1, 2015
1 parent 665ac8c commit d33ba8e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
1 change: 1 addition & 0 deletions modules/bindbackend/bindbackend2.hh
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
#include "pdns/lock.hh" #include "pdns/lock.hh"
#include "pdns/misc.hh" #include "pdns/misc.hh"
#include "pdns/dnsbackend.hh" #include "pdns/dnsbackend.hh"
#include "pdns/logger.hh"


#include "pdns/namespaces.hh" #include "pdns/namespaces.hh"
using namespace ::boost::multi_index; using namespace ::boost::multi_index;
Expand Down
13 changes: 8 additions & 5 deletions modules/bindbackend/binddnssec.cc
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -108,16 +108,19 @@ bool Bind2Backend::getNSEC3PARAM(const std::string& zname, NSEC3PARAMRecordConte
getDomainMetadata(zname, "NSEC3PARAM", meta); getDomainMetadata(zname, "NSEC3PARAM", meta);
if(!meta.empty()) if(!meta.empty())
value=*meta.begin(); value=*meta.begin();

else
if(value.empty()) { // "no NSEC3" return false; // "no NSEC3"
return false;
} static int maxNSEC3Iterations=::arg().asNum("max-nsec3-iterations");

if(ns3p) { if(ns3p) {
NSEC3PARAMRecordContent* tmp=dynamic_cast<NSEC3PARAMRecordContent*>(DNSRecordContent::mastermake(QType::NSEC3PARAM, 1, value)); NSEC3PARAMRecordContent* tmp=dynamic_cast<NSEC3PARAMRecordContent*>(DNSRecordContent::mastermake(QType::NSEC3PARAM, 1, value));
*ns3p = *tmp; *ns3p = *tmp;
delete tmp; delete tmp;
} }
if (ns3p->d_iterations > maxNSEC3Iterations) {
ns3p->d_iterations = maxNSEC3Iterations;
L<<Logger::Error<<"Number of NSEC3 iterations for zone '"<<zname<<"' is above 'max-nsec3-iterations'. Value adjsted to: "<<maxNSEC3Iterations<<endl;
}
return true; return true;
} }


Expand Down

0 comments on commit d33ba8e

Please sign in to comment.