From: bert hubert Date: Wed, 30 Sep 2015 18:42:54 +0000 (+0200) Subject: the great d_label -> d_name cleanup! X-Git-Tag: dnsdist-1.0.0-alpha1~248^2~28^2~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f809c028d4a9bb973da8b93e8f4844395f1c3eab;p=thirdparty%2Fpdns.git the great d_label -> d_name cleanup! --- diff --git a/pdns/dnsbulktest.cc b/pdns/dnsbulktest.cc index 868c8bca5d..d6abc139d3 100644 --- a/pdns/dnsbulktest.cc +++ b/pdns/dnsbulktest.cc @@ -136,7 +136,7 @@ struct SendReceive } if(!g_quiet) { - cout<first.d_place-1<<"\t"<first.d_label.toString()<<"\tIN\t"<first.d_type); + cout<first.d_place-1<<"\t"<first.d_name.toString()<<"\tIN\t"<first.d_type); cout<<"\t"<first.d_ttl<<"\t"<< i->first.d_content->getZoneRepresentation()<<"\n"; } } diff --git a/pdns/dnspacket.cc b/pdns/dnspacket.cc index 9c57409d33..dbf6b239a7 100644 --- a/pdns/dnspacket.cc +++ b/pdns/dnspacket.cc @@ -474,7 +474,7 @@ bool DNSPacket::getTSIGDetails(TSIGRecordContent* trc, DNSName* keyname, string* *trc = *std::dynamic_pointer_cast(i->first.d_content); gotit=true; - *keyname = i->first.d_label; + *keyname = i->first.d_name; } } if(!gotit) @@ -498,7 +498,7 @@ bool DNSPacket::getTKEYRecord(TKEYRecordContent *tr, DNSName *keyname) const if(i->first.d_type == QType::TKEY) { *tr = *std::dynamic_pointer_cast(i->first.d_content); - *keyname = i->first.d_label; + *keyname = i->first.d_name; gotit=true; } } diff --git a/pdns/dnsparser.cc b/pdns/dnsparser.cc index fee0bc82a1..e5a151923d 100644 --- a/pdns/dnsparser.cc +++ b/pdns/dnsparser.cc @@ -47,7 +47,7 @@ public: const string& relevant=(parts.size() > 2) ? parts[2] : ""; unsigned int total=atoi(parts[1].c_str()); if(relevant.size()!=2*total) - throw MOADNSException((boost::format("invalid unknown record length for label %s: size not equal to length field (%d != %d)") % d_dr.d_label.toString() % relevant.size() % (2*total)).str()); + throw MOADNSException((boost::format("invalid unknown record length for label %s: size not equal to length field (%d != %d)") % d_dr.d_name.toString() % relevant.size() % (2*total)).str()); string out; out.reserve(total+1); for(unsigned int n=0; n < total; ++n) { @@ -135,7 +135,7 @@ shared_ptr DNSRecordContent::unserialize(const DNSName& qname, MOADNSParser mdp((char*)&*packet.begin(), (unsigned int)packet.size()); shared_ptr ret= mdp.d_answers.begin()->first.d_content; ret->header.d_type=ret->d_qtype; - ret->label=mdp.d_answers.begin()->first.d_label; + ret->label=mdp.d_answers.begin()->first.d_name; ret->header.d_ttl=mdp.d_answers.begin()->first.d_ttl; return ret; } @@ -255,14 +255,14 @@ void MOADNSParser::init(const char *packet, unsigned int len) unsigned int recordStartPos=pr.d_pos; - DNSName label=pr.getName(); + DNSName name=pr.getName(); pr.getDnsrecordheader(ah); dr.d_ttl=ah.d_ttl; dr.d_type=ah.d_type; dr.d_class=ah.d_class; - dr.d_label=label; + dr.d_name=name; dr.d_clen=ah.d_clen; dr.d_content=std::shared_ptr(DNSRecordContent::mastermake(dr, pr, d_header.opcode)); diff --git a/pdns/dnsparser.hh b/pdns/dnsparser.hh index 1a67066bf5..9c02b8079b 100644 --- a/pdns/dnsparser.hh +++ b/pdns/dnsparser.hh @@ -263,7 +263,7 @@ protected: struct DNSRecord { - DNSName d_label; //FIXME400 rename + DNSName d_name; std::shared_ptr d_content; uint16_t d_type; uint16_t d_class; @@ -279,9 +279,10 @@ struct DNSRecord if(rhs.d_content) rzrp=toLower(rhs.d_content->getZoneRepresentation()); - string llabel=toLower(d_label.toString()); //FIXME400 - string rlabel=toLower(rhs.d_label.toString()); //FIXME400 + string llabel=toLower(d_name.toString()); + string rlabel=toLower(rhs.d_name.toString()); + // XXX is anyone expecting a specific canonical ordering? can we use DNSName builtin < ? return tie(llabel, d_type, d_class, lzrp) < tie(rlabel, rhs.d_type, rhs.d_class, rzrp); @@ -295,8 +296,8 @@ struct DNSRecord if(rhs.d_content) rzrp=toLower(rhs.d_content->getZoneRepresentation()); - string llabel=toLower(d_label.toString()); //FIXME400 - string rlabel=toLower(rhs.d_label.toString()); //FIXME400 + string llabel=toLower(d_name.toString()); + string rlabel=toLower(rhs.d_name.toString()); return tie(llabel, d_type, d_class, lzrp) == diff --git a/pdns/dnsrecords.cc b/pdns/dnsrecords.cc index b4b3ca81ba..5ab5d5dcda 100644 --- a/pdns/dnsrecords.cc +++ b/pdns/dnsrecords.cc @@ -72,7 +72,7 @@ DNSResourceRecord::DNSResourceRecord(const DNSRecord &p) { auth=true; qclass = p.d_class; disabled=false; - qname = p.d_label; + qname = p.d_name; d_place = (DNSResourceRecord::Place)p.d_place; // if(!qname.empty()) // boost::erase_tail(qname, 1); // strip . diff --git a/pdns/dnsreplay.cc b/pdns/dnsreplay.cc index 47979ce986..154fe8229e 100644 --- a/pdns/dnsreplay.cc +++ b/pdns/dnsreplay.cc @@ -277,10 +277,10 @@ bool isRootReferral(const MOADNSParser::answers_t& answers) bool ok=true; for(MOADNSParser::answers_t::const_iterator iter = answers.begin(); iter != answers.end(); ++iter) { - // cerr<<(int)iter->first.d_place<<", "<first.d_label<<" "<first.d_type<<", # "<first.d_place<<", "<first.d_name<<" "<first.d_type<<", # "<first.d_place!=2) ok=false; - if(!iter->first.d_label.isRoot() || iter->first.d_type!=QType::NS) + if(!iter->first.d_name.isRoot() || iter->first.d_type!=QType::NS) ok=false; } return ok; @@ -379,10 +379,10 @@ void measureResultAndClean(qids_t::const_iterator iter) if(!g_quiet) { cout<<"orig: rcode="<::const_iterator i=canonicOrig.begin(); i!=canonicOrig.end(); ++i) - cout<<"\t"<d_label.toString()<<"\t"<d_type)<<"\t'" << (i->d_content ? i->d_content->getZoneRepresentation() : "") <<"'\n"; + cout<<"\t"<d_name.toString()<<"\t"<d_type)<<"\t'" << (i->d_content ? i->d_content->getZoneRepresentation() : "") <<"'\n"; cout<<"new: rcode="<::const_iterator i=canonicNew.begin(); i!=canonicNew.end(); ++i) - cout<<"\t"<d_label.toString()<<"\t"<d_type)<<"\t'" << (i->d_content ? i->d_content->getZoneRepresentation() : "") <<"'\n"; + cout<<"\t"<d_name.toString()<<"\t"<d_type)<<"\t'" << (i->d_content ? i->d_content->getZoneRepresentation() : "") <<"'\n"; cout<<"\n"; cout<<"-\n"; diff --git a/pdns/nsec3dig.cc b/pdns/nsec3dig.cc index ae06576197..15e4632cad 100644 --- a/pdns/nsec3dig.cc +++ b/pdns/nsec3dig.cc @@ -131,13 +131,13 @@ try for(MOADNSParser::answers_t::const_iterator i=mdp.d_answers.begin(); i!=mdp.d_answers.end(); ++i) { if(i->first.d_type == QType::NSEC3) { - // cerr<<"got nsec3 ["<first.d_label<<"]"<first.d_name<<"]"<first.d_content->getZoneRepresentation()< (*(i->first.d_content)); // nsec3.insert(new nsec3() // cerr< parts; - string sname=i->first.d_label.toString(); + string sname=i->first.d_name.toString(); boost::split(parts, sname /* FIXME400 */, boost::is_any_of(".")); nsec3s.insert(make_pair(toLower(parts[0]), toBase32Hex(r.d_nexthash))); nsec3salt = r.d_salt; @@ -145,9 +145,9 @@ try } else { - // cerr<<"namesseen.insert('"<first.d_label<<"')"<first.d_label); - namesseen.insert(i->first.d_label); + // cerr<<"namesseen.insert('"<first.d_name<<"')"<first.d_name); + namesseen.insert(i->first.d_name); } if(i->first.d_type == QType::CNAME) @@ -155,7 +155,7 @@ try namesseen.insert(DNSName(i->first.d_content->getZoneRepresentation())); } - cout<first.d_place-1<<"\t"<first.d_label.toString()<<"\tIN\t"<first.d_type); + cout<first.d_place-1<<"\t"<first.d_name.toString()<<"\tIN\t"<first.d_type); cout<<"\t"<first.d_ttl<<"\t"<< i->first.d_content->getZoneRepresentation()<<"\n"; } diff --git a/pdns/resolver.cc b/pdns/resolver.cc index 9f81053258..e0d2b65e22 100644 --- a/pdns/resolver.cc +++ b/pdns/resolver.cc @@ -196,7 +196,7 @@ static int parseResult(MOADNSParser& mdp, const DNSName& origQname, uint16_t ori vector ret; DNSResourceRecord rr; for(MOADNSParser::answers_t::const_iterator i=mdp.d_answers.begin(); i!=mdp.d_answers.end(); ++i) { - rr.qname = i->first.d_label; + rr.qname = i->first.d_name; rr.qtype = i->first.d_type; rr.ttl = i->first.d_ttl; rr.content = i->first.d_content->getZoneRepresentation(); diff --git a/pdns/rfc2136handler.cc b/pdns/rfc2136handler.cc index b4e35b64f8..093b8f46bb 100644 --- a/pdns/rfc2136handler.cc +++ b/pdns/rfc2136handler.cc @@ -31,7 +31,7 @@ int PacketHandler::checkUpdatePrerequisites(const DNSRecord *rr, DomainInfo *di) bool foundRecord=false; DNSResourceRecord rec; - di->backend->lookup(QType(QType::ANY), rr->d_label); + di->backend->lookup(QType(QType::ANY), rr->d_name); while(di->backend->get(rec)) { if (!rec.qtype.getCode()) continue; @@ -92,17 +92,17 @@ uint PacketHandler::performUpdate(const string &msgPrefix, const DNSRecord *rr, QType rrType = QType(rr->d_type); if (rrType == QType::NSEC || rrType == QType::NSEC3) { - L<d_label<<"|"<d_name<<"|"<d_label<<"|"<d_name<<"|"<d_label != di->zone) { - L<d_label<<"|"<d_name != di->zone) { + L<d_name<<"|"<d_class == QClass::IN) { // 3.4.2.2 QClass::IN means insert or update - DLOG(L<d_label<<"|"<d_name<<"|"<backend->lookup(rrType, rr->d_label); + di->backend->lookup(rrType, rr->d_name); while (di->backend->get(rec)) { rrset.push_back(rec); foundRecord = true; @@ -187,7 +187,7 @@ uint PacketHandler::performUpdate(const string &msgPrefix, const DNSRecord *rr, di->backend->replaceRRSet(di->id, oldRec->qname, oldRec->qtype, rrset); *updatedSerial = true; changedRecords++; - L<d_label<<"|"<d_name<<"|"< 0) { - di->backend->replaceRRSet(di->id, rr->d_label, rrType, rrset); - L<d_label<<"|"<backend->replaceRRSet(di->id, rr->d_name, rrType, rrset); + L<d_name<<"|"<d_label<<"|"<d_name<<"|"< 0) { - di->backend->replaceRRSet(di->id, rr->d_label, rrType, rrset); - L<d_label<<"|"<backend->replaceRRSet(di->id, rr->d_name, rrType, rrset); + L<d_name<<"|"<d_label<<"|"<d_name<<"|"<d_label)))+di->zone; + ordername=DNSName(toBase32Hex(hashQNameWithSalt(*ns3pr, rr->d_name)))+di->zone; if (*narrow) - di->backend->updateDNSSECOrderNameAndAuth(di->id, di->zone, rr->d_label, DNSName(), auth); + di->backend->updateDNSSECOrderNameAndAuth(di->id, di->zone, rr->d_name, DNSName(), auth); else - di->backend->updateDNSSECOrderNameAndAuth(di->id, di->zone, rr->d_label, ordername, auth); + di->backend->updateDNSSECOrderNameAndAuth(di->id, di->zone, rr->d_name, ordername, auth); if(!auth || rrType == QType::DS) { - di->backend->updateDNSSECOrderNameAndAuth(di->id, di->zone, rr->d_label, DNSName(), false, QType::NS); - di->backend->updateDNSSECOrderNameAndAuth(di->id, di->zone, rr->d_label, DNSName(), false, QType::A); - di->backend->updateDNSSECOrderNameAndAuth(di->id, di->zone, rr->d_label, DNSName(), false, QType::AAAA); + di->backend->updateDNSSECOrderNameAndAuth(di->id, di->zone, rr->d_name, DNSName(), false, QType::NS); + di->backend->updateDNSSECOrderNameAndAuth(di->id, di->zone, rr->d_name, DNSName(), false, QType::A); + di->backend->updateDNSSECOrderNameAndAuth(di->id, di->zone, rr->d_name, DNSName(), false, QType::AAAA); } } else { // NSEC - di->backend->updateDNSSECOrderNameAndAuth(di->id, di->zone, rr->d_label, rr->d_label, auth); + di->backend->updateDNSSECOrderNameAndAuth(di->id, di->zone, rr->d_name, rr->d_name, auth); if(!auth || rrType == QType::DS) { - di->backend->updateDNSSECOrderNameAndAuth(di->id, di->zone, rr->d_label, DNSName(), false, QType::A); - di->backend->updateDNSSECOrderNameAndAuth(di->id, di->zone, rr->d_label, DNSName(), false, QType::AAAA); + di->backend->updateDNSSECOrderNameAndAuth(di->id, di->zone, rr->d_name, DNSName(), false, QType::A); + di->backend->updateDNSSECOrderNameAndAuth(di->id, di->zone, rr->d_name, DNSName(), false, QType::AAAA); } } } @@ -266,17 +266,17 @@ uint PacketHandler::performUpdate(const string &msgPrefix, const DNSRecord *rr, // If we haven't found a record that matches, we must add it. if (! foundRecord) { - L<d_label<<"|"<d_label); // always remove any ENT's in the place where we're going to add a record. + L<d_name<<"|"<d_name); // always remove any ENT's in the place where we're going to add a record. DNSResourceRecord newRec(*rr); newRec.domain_id = di->id; - newRec.auth = (rr->d_label == di->zone || rrType.getCode() != QType::NS); + newRec.auth = (rr->d_name == di->zone || rrType.getCode() != QType::NS); di->backend->feedRecord(newRec); changedRecords++; // because we added a record, we need to fix DNSSEC data. - DNSName shorter(rr->d_label); + DNSName shorter(rr->d_name); bool auth=newRec.auth; bool fixDS = (rrType == QType::DS); @@ -289,15 +289,15 @@ uint PacketHandler::performUpdate(const string &msgPrefix, const DNSRecord *rr, bool foundShorter = false; di->backend->lookup(QType(QType::ANY), shorter); while (di->backend->get(rec)) { - if (rec.qname == rr->d_label && rec.qtype == QType::DS) + if (rec.qname == rr->d_name && rec.qtype == QType::DS) fixDS = true; - if (shorter != rr->d_label) + if (shorter != rr->d_name) foundShorter = true; if (rec.qtype == QType::NS) // are we inserting below a delegate? auth=false; } - if (!foundShorter && auth && shorter != rr->d_label) // haven't found any record at current level, insert ENT. + if (!foundShorter && auth && shorter != rr->d_name) // haven't found any record at current level, insert ENT. insnonterm.insert(shorter); if (foundShorter) break; // if we find a shorter record, we can stop searching @@ -308,46 +308,46 @@ uint PacketHandler::performUpdate(const string &msgPrefix, const DNSRecord *rr, { DNSName ordername; if(! *narrow) - ordername=DNSName(toBase32Hex(hashQNameWithSalt(*ns3pr, rr->d_label)))+di->zone; + ordername=DNSName(toBase32Hex(hashQNameWithSalt(*ns3pr, rr->d_name)))+di->zone; if (*narrow) - di->backend->updateDNSSECOrderNameAndAuth(di->id, di->zone, rr->d_label, DNSName(), auth); + di->backend->updateDNSSECOrderNameAndAuth(di->id, di->zone, rr->d_name, DNSName(), auth); else - di->backend->updateDNSSECOrderNameAndAuth(di->id, di->zone, rr->d_label, ordername, auth); + di->backend->updateDNSSECOrderNameAndAuth(di->id, di->zone, rr->d_name, ordername, auth); if (fixDS) - di->backend->updateDNSSECOrderNameAndAuth(di->id, di->zone, rr->d_label, ordername, true, QType::DS); + di->backend->updateDNSSECOrderNameAndAuth(di->id, di->zone, rr->d_name, ordername, true, QType::DS); if(!auth) { if (ns3pr->d_flags) - di->backend->updateDNSSECOrderNameAndAuth(di->id, di->zone, rr->d_label, DNSName(), false, QType::NS); - di->backend->updateDNSSECOrderNameAndAuth(di->id, di->zone, rr->d_label, DNSName(), false, QType::A); - di->backend->updateDNSSECOrderNameAndAuth(di->id, di->zone, rr->d_label, DNSName(), false, QType::AAAA); + di->backend->updateDNSSECOrderNameAndAuth(di->id, di->zone, rr->d_name, DNSName(), false, QType::NS); + di->backend->updateDNSSECOrderNameAndAuth(di->id, di->zone, rr->d_name, DNSName(), false, QType::A); + di->backend->updateDNSSECOrderNameAndAuth(di->id, di->zone, rr->d_name, DNSName(), false, QType::AAAA); } } else // NSEC { - di->backend->updateDNSSECOrderNameAndAuth(di->id, di->zone, rr->d_label, rr->d_label, auth); + di->backend->updateDNSSECOrderNameAndAuth(di->id, di->zone, rr->d_name, rr->d_name, auth); if (fixDS) { - di->backend->updateDNSSECOrderNameAndAuth(di->id, di->zone, rr->d_label, rr->d_label, true, QType::DS); + di->backend->updateDNSSECOrderNameAndAuth(di->id, di->zone, rr->d_name, rr->d_name, true, QType::DS); } if(!auth) { - di->backend->updateDNSSECOrderNameAndAuth(di->id, di->zone, rr->d_label, DNSName(), false, QType::A); - di->backend->updateDNSSECOrderNameAndAuth(di->id, di->zone, rr->d_label, DNSName(), false, QType::AAAA); + di->backend->updateDNSSECOrderNameAndAuth(di->id, di->zone, rr->d_name, DNSName(), false, QType::A); + di->backend->updateDNSSECOrderNameAndAuth(di->id, di->zone, rr->d_name, DNSName(), false, QType::AAAA); } } // If we insert an NS, all the records below it become non auth - so, we're inserting a delegate. - // Auth can only be false when the rr->d_label is not the zone + // Auth can only be false when the rr->d_name is not the zone if (auth == false && rrType == QType::NS) { - DLOG(L<d_label<d_name< qnames; - di->backend->listSubZone(rr->d_label, di->id); + di->backend->listSubZone(rr->d_name, di->id); while(di->backend->get(rec)) { - if (rec.qtype.getCode() && rec.qtype.getCode() != QType::DS && rr->d_label != rec.qname) // Skip ENT, DS and our already corrected record. + if (rec.qtype.getCode() && rec.qtype.getCode() != QType::DS && rr->d_name != rec.qname) // Skip ENT, DS and our already corrected record. qnames.push_back(rec.qname); } for(vector::const_iterator qname=qnames.begin(); qname != qnames.end(); ++qname) { @@ -357,7 +357,7 @@ uint PacketHandler::performUpdate(const string &msgPrefix, const DNSRecord *rr, ordername=DNSName(toBase32Hex(hashQNameWithSalt(*ns3pr, *qname)))+di->zone; if (*narrow) - di->backend->updateDNSSECOrderNameAndAuth(di->id, di->zone, rr->d_label, DNSName(), auth); // FIXME400 no *qname here? + di->backend->updateDNSSECOrderNameAndAuth(di->id, di->zone, rr->d_name, DNSName(), auth); // FIXME400 no *qname here? else di->backend->updateDNSSECOrderNameAndAuth(di->id, di->zone, *qname, ordername, auth); @@ -378,16 +378,16 @@ uint PacketHandler::performUpdate(const string &msgPrefix, const DNSRecord *rr, // Delete records - section 3.4.2.3 and 3.4.2.4 with the exception of the 'always leave 1 NS rule' as that's handled by // the code that calls this performUpdate(). if ((rr->d_class == QClass::ANY || rr->d_class == QClass::NONE) && rrType != QType::SOA) { // never delete a SOA. - DLOG(L<d_label<<"; QClasse:"<d_class<<"; rrType: "<d_name<<"; QClasse:"<d_class<<"; rrType: "<d_class == QClass::ANY) - d_dk.unsetNSEC3PARAM(rr->d_label); + d_dk.unsetNSEC3PARAM(rr->d_name); else if (rr->d_class == QClass::NONE) { NSEC3PARAMRecordContent nsec3rr(rr->d_content->getZoneRepresentation(), di->zone.toString() /* FIXME400 huh */); if (ns3pr->getZoneRepresentation() == nsec3rr.getZoneRepresentation()) - d_dk.unsetNSEC3PARAM(rr->d_label); + d_dk.unsetNSEC3PARAM(rr->d_name); else return 0; } else @@ -438,7 +438,7 @@ uint PacketHandler::performUpdate(const string &msgPrefix, const DNSRecord *rr, } // end of NSEC3PARAM delete block - di->backend->lookup(rrType, rr->d_label); + di->backend->lookup(rrType, rr->d_name); while(di->backend->get(rec)) { if (rr->d_class == QClass::ANY) { // 3.4.2.3 if (rec.qname == di->zone && (rec.qtype == QType::NS || rec.qtype == QType::SOA)) // Never delete all SOA and NS's @@ -455,19 +455,19 @@ uint PacketHandler::performUpdate(const string &msgPrefix, const DNSRecord *rr, } if (recordsToDelete.size()) { - di->backend->replaceRRSet(di->id, rr->d_label, rrType, rrset); - L<d_label<<"|"<backend->replaceRRSet(di->id, rr->d_name, rrType, rrset); + L<d_name<<"|"<d_label != di->zone) { + if (rrType == QType::NS && rr->d_name != di->zone) { vector belowOldDelegate, nsRecs, updateAuthFlag; - di->backend->listSubZone(rr->d_label, di->id); + di->backend->listSubZone(rr->d_name, di->id); while (di->backend->get(rec)) { if (rec.qtype.getCode()) // skip ENT records, they are always auth=false belowOldDelegate.push_back(rec.qname); - if (rec.qtype.getCode() == QType::NS && rec.qname != rr->d_label) + if (rec.qtype.getCode() == QType::NS && rec.qname != rr->d_name) nsRecs.push_back(rec.qname); } @@ -502,20 +502,20 @@ uint PacketHandler::performUpdate(const string &msgPrefix, const DNSRecord *rr, // on that level. If so, we must insert an ENT record. // We take extra care here to not 'include' the record that we just deleted. Some backends will still return it as they only reload on a commit. bool foundDeeper = false, foundOtherWithSameName = false; - di->backend->listSubZone(rr->d_label, di->id); + di->backend->listSubZone(rr->d_name, di->id); while (di->backend->get(rec)) { - if (rec.qname == rr->d_label && !count(recordsToDelete.begin(), recordsToDelete.end(), rec)) + if (rec.qname == rr->d_name && !count(recordsToDelete.begin(), recordsToDelete.end(), rec)) foundOtherWithSameName = true; - if (rec.qname != rr->d_label && rec.qtype.getCode() != QType::NS) //Skip NS records, as this would be a delegate that we can ignore as this does not require us to create a ENT + if (rec.qname != rr->d_name && rec.qtype.getCode() != QType::NS) //Skip NS records, as this would be a delegate that we can ignore as this does not require us to create a ENT foundDeeper = true; } if (foundDeeper && !foundOtherWithSameName) { - insnonterm.insert(rr->d_label); + insnonterm.insert(rr->d_name); } else if (!foundOtherWithSameName) { // If we didn't have to insert an ENT, we might have deleted a record at very deep level // and we must then clean up the ENT's above the deleted record. - DNSName shorter(rr->d_label); + DNSName shorter(rr->d_name); while (shorter != di->zone) { shorter.chopOff(); bool foundRealRR = false; @@ -543,7 +543,7 @@ uint PacketHandler::performUpdate(const string &msgPrefix, const DNSRecord *rr, } } } else { // if (recordsToDelete.size()) - L<d_label<<"|"<d_name<<"|"<d_place == DNSRecord::Answer || rr->d_place == DNSRecord::Nameserver)) continue; - if (!rr->d_label.isPartOf(di.zone)) { + if (!rr->d_name.isPartOf(di.zone)) { L<d_class == QClass::IN) { - rrSetKey_t key = make_pair(rr->d_label, QType(rr->d_type)); + rrSetKey_t key = make_pair(rr->d_name, QType(rr->d_type)); rrVector_t *vec = &preReqRRsets[key]; vec->push_back(DNSResourceRecord(*rr)); } @@ -867,7 +867,7 @@ int PacketHandler::processUpdate(DNSPacket *p) { for(MOADNSParser::answers_t::const_iterator i=mdp.d_answers.begin(); i != mdp.d_answers.end(); ++i) { const DNSRecord *rr = &i->first; if (rr->d_place == DNSRecord::Nameserver) { - if (rr->d_class == QClass::NONE && rr->d_type == QType::NS && rr->d_label == di.zone) + if (rr->d_class == QClass::NONE && rr->d_type == QType::NS && rr->d_name == di.zone) nsRRtoDelete.push_back(rr); else changedRecords += performUpdate(msgPrefix, rr, &di, isPresigned, &narrow, &haveNSEC3, &ns3pr, &updatedSerial); diff --git a/pdns/saxfr.cc b/pdns/saxfr.cc index a5bd347969..768e0b513d 100644 --- a/pdns/saxfr.cc +++ b/pdns/saxfr.cc @@ -290,9 +290,9 @@ try o<<"\t"<first.d_content->getZoneRepresentation(); } - records.push_back(make_pair(i->first.d_label,o.str())); + records.push_back(make_pair(i->first.d_name,o.str())); - DNSName shorter(i->first.d_label); + DNSName shorter(i->first.d_name); do { labels.insert(shorter); if (shorter == DNSName(argv[3])) diff --git a/pdns/sdig.cc b/pdns/sdig.cc index 41187fecae..4726899ed8 100644 --- a/pdns/sdig.cc +++ b/pdns/sdig.cc @@ -127,7 +127,7 @@ try cout<<", TC: "<first.d_place-1<<"\t"<first.d_label.toString()<<"\tIN\t"<first.d_type); + cout<first.d_place-1<<"\t"<first.d_name.toString()<<"\tIN\t"<first.d_type); if(i->first.d_type == QType::RRSIG) { string zoneRep = i->first.d_content->getZoneRepresentation(); diff --git a/pdns/secpoll-auth.cc b/pdns/secpoll-auth.cc index ace74c9858..ca013f8310 100644 --- a/pdns/secpoll-auth.cc +++ b/pdns/secpoll-auth.cc @@ -111,7 +111,7 @@ int doResolve(const string& qname, uint16_t qtype, vector& re for(MOADNSParser::answers_t::const_iterator i=mdp.d_answers.begin(); i!=mdp.d_answers.end(); ++i) { if(i->first.d_place == 1 && i->first.d_type==QType::TXT) { DNSResourceRecord rr; - rr.qname = i->first.d_label; + rr.qname = i->first.d_name; rr.qtype = QType(i->first.d_type); rr.content = i->first.d_content->getZoneRepresentation(); rr.ttl=i->first.d_ttl; diff --git a/pdns/syncres.cc b/pdns/syncres.cc index 9a31f3d62a..3e8b692d35 100644 --- a/pdns/syncres.cc +++ b/pdns/syncres.cc @@ -1043,8 +1043,8 @@ int SyncRes::doResolveAt(set nameservers, DNSName auth, bool flawedNSSe for(const auto& rec : lwr.d_records) { if(rec.first.d_type == QType::RRSIG) { auto rrsig = std::dynamic_pointer_cast(rec.first.d_content); - cerr<<"Got an RRSIG for "<d_type)<<" with name '"<d_type))].signatures.push_back(rrsig); + cerr<<"Got an RRSIG for "<d_type)<<" with name '"<d_type))].signatures.push_back(rrsig); } } } diff --git a/pdns/tkey.cc b/pdns/tkey.cc index 85ffc0dd73..fa9283de29 100644 --- a/pdns/tkey.cc +++ b/pdns/tkey.cc @@ -6,33 +6,33 @@ void PacketHandler::tkeyHandler(DNSPacket *p, DNSPacket *r) { TKEYRecordContent tkey_in; std::shared_ptr tkey_out(new TKEYRecordContent()); - DNSName label; + DNSName name; bool sign = false; - if (!p->getTKEYRecord(&tkey_in, &label)) { + if (!p->getTKEYRecord(&tkey_in, &name)) { L<setRcode(RCode::FormErr); return; } - // retain original label for response + // retain original name for response tkey_out->d_error = 0; tkey_out->d_mode = tkey_in.d_mode; tkey_out->d_algo = tkey_in.d_algo; tkey_out->d_inception = time((time_t*)NULL); tkey_out->d_expiration = tkey_out->d_inception+15; - GssContext ctx(label.toStringNoDot()); + GssContext ctx(name.toStringNoDot()); if (tkey_in.d_mode == 3) { // establish context if (tkey_in.d_algo == DNSName("gss-tsig.")) { std::vector meta; - DNSName tmpLabel(label); + DNSName tmpName(name); do { - if (B.getDomainMetadata(tmpLabel, "GSS-ACCEPTOR-PRINCIPAL", meta) && meta.size()>0) { + if (B.getDomainMetadata(tmpName, "GSS-ACCEPTOR-PRINCIPAL", meta) && meta.size()>0) { break; } - } while(tmpLabel.chopOff()); + } while(tmpName.chopOff()); if (meta.size()>0) { ctx.setLocalPrincipal(meta[0]); @@ -72,7 +72,7 @@ void PacketHandler::tkeyHandler(DNSPacket *p, DNSPacket *r) { tkey_out->d_othersize = tkey_out->d_other.size(); DNSRecord rec; - rec.d_label = label; + rec.d_name = name; rec.d_ttl = 0; rec.d_type = QType::TKEY; rec.d_class = QClass::ANY; @@ -94,8 +94,8 @@ void PacketHandler::tkeyHandler(DNSPacket *p, DNSPacket *r) { trc.d_origID = p->d.id; trc.d_eRcode = 0; trc.d_otherData = ""; - // this should cause it to lookup label context - r->setTSIGDetails(trc, label, label.toStringNoDot(), "", false); + // this should cause it to lookup name context + r->setTSIGDetails(trc, name, name.toStringNoDot(), "", false); } r->commitD();