From: Kees Monshouwer Date: Mon, 27 Jul 2015 15:20:23 +0000 (+0200) Subject: remove unused variable and cleanup emitNSEC3() X-Git-Tag: dnsdist-1.0.0-alpha1~248^2~58^2~9^2~4 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=576e7e0f8c13bbdc07cfa4d38983f5747425d87c;p=pdns remove unused variable and cleanup emitNSEC3() --- diff --git a/pdns/packethandler.cc b/pdns/packethandler.cc index 2ce5570ca..969eedf3e 100644 --- a/pdns/packethandler.cc +++ b/pdns/packethandler.cc @@ -390,10 +390,13 @@ void PacketHandler::emitNSEC(DNSPacket *r, const SOAData& sd, const DNSName& nam nrc.d_set.insert(QType::NSEC); nrc.d_set.insert(QType::RRSIG); - if(sd.qname == name) + if(sd.qname == name) { + nrc.d_set.insert(QType::SOA); // 1dfd8ad SOA can live outside the records table nrc.d_set.insert(QType::DNSKEY); + } DNSResourceRecord rr; + B.lookup(QType(QType::ANY), name, NULL, sd.domain_id); while(B.get(rr)) { if(rr.qtype.getCode() == QType::NS || rr.auth) @@ -410,37 +413,35 @@ void PacketHandler::emitNSEC(DNSPacket *r, const SOAData& sd, const DNSName& nam r->addRecord(rr); } - -void emitNSEC3(UeberBackend& B, const NSEC3PARAMRecordContent& ns3prc, const SOAData& sd, const DNSName& unhashed, const string& begin, const string& end, const DNSName& toNSEC3, DNSPacket *r, int mode) +void PacketHandler::emitNSEC3(DNSPacket *r, const SOAData& sd, const NSEC3PARAMRecordContent& ns3prc, const DNSName& name, const string& namehash, const string& nexthash, int mode) { - // cerr<<"We should emit NSEC3 '"<addRecord(rr); } -void PacketHandler::emitNSEC3(const NSEC3PARAMRecordContent& ns3prc, const SOAData& sd, const DNSName& unhashed, const string& begin, const string& end, /* FIXME400 unused */ const DNSName& toNSEC3, DNSPacket *r, int mode) -{ - ::emitNSEC3(B, ns3prc, sd, unhashed, begin, end, toNSEC3, r, mode); - -} - /* mode 0 = No Data Responses, QTYPE is not DS mode 1 = No Data Responses, QTYPE is DS @@ -594,7 +589,7 @@ void PacketHandler::addNSEC3(DNSPacket *p, DNSPacket *r, const DNSName& target, if (!after.empty()) { DLOG(L<<"Done calling for matching, hashed: '"<addRecord(rr); } @@ -612,7 +607,7 @@ void PacketHandler::addNSEC3(DNSPacket *p, DNSPacket *r, const DNSName& target, // if(!B.getDirectNSECx(sd.domain_id, hashed, QType(QType::NSEC3), before, rr)) { getNSEC3Hashes(narrow, sd.db,sd.domain_id, hashed, true, unhashed, before, after); DLOG(L<<"Done calling for covering, hashed: '"<addRecord(rr); } @@ -627,7 +622,7 @@ void PacketHandler::addNSEC3(DNSPacket *p, DNSPacket *r, const DNSName& target, // if(!B.getDirectNSECx(sd.domain_id, hashed, QType(QType::NSEC3), before, rr)) { getNSEC3Hashes(narrow, sd.db, sd.domain_id, hashed, (mode != 2), unhashed, before, after); DLOG(L<<"Done calling for '*', hashed: '"<addRecord(rr); } diff --git a/pdns/packethandler.hh b/pdns/packethandler.hh index d9ce37a51..2c52f781b 100644 --- a/pdns/packethandler.hh +++ b/pdns/packethandler.hh @@ -78,7 +78,7 @@ private: void addNSEC(DNSPacket *p, DNSPacket* r, const DNSName &target, const DNSName &wildcard, const DNSName& auth, int mode); void addNSEC3(DNSPacket *p, DNSPacket* r, const DNSName &target, const DNSName &wildcard, const DNSName& auth, const NSEC3PARAMRecordContent& nsec3param, bool narrow, int mode); void emitNSEC(DNSPacket *r, const SOAData& sd, const DNSName& name, const DNSName& next, int mode); - void emitNSEC3(const NSEC3PARAMRecordContent &ns3rc, const SOAData& sd, const DNSName& unhashed, /* FIXME400 should this be DNSName? */ const string& begin, const string& end, const DNSName& toNSEC3, DNSPacket *r, int mode); + void emitNSEC3(DNSPacket *r, const SOAData& sd, const NSEC3PARAMRecordContent &ns3rc, const DNSName& unhashed, const string& begin, const string& end, int mode); int processUpdate(DNSPacket *p); int forwardPacket(const string &msgPrefix, DNSPacket *p, DomainInfo *di); uint performUpdate(const string &msgPrefix, const DNSRecord *rr, DomainInfo *di, bool isPresigned, bool* narrow, bool* haveNSEC3, NSEC3PARAMRecordContent *ns3pr, bool *updatedSerial);