those are fields of a class.
std::string ser = const_cast<DNSZoneRecord&>(rr).dr.d_content->serialize(rr.dr.d_name);
auto hash = boost::hash< std::pair<DNSName, std::string> >()({rr.dr.d_name, ser});
if(d_dedup.count(hash)) { // might be a dup
- for(auto & d_rr : d_rrs) {
- if(rr.dr == d_rr.dr) // XXX SUPER SLOW
+ for(auto & i : d_rrs) {
+ if(rr.dr == i.dr) // XXX SUPER SLOW
return;
}
}
{
vector<DNSZoneRecord*> arrs;
- for(auto & d_rr : d_rrs)
+ for(auto & i : d_rrs)
{
- if(d_rr.dr.d_place!=DNSResourceRecord::ADDITIONAL &&
- (d_rr.dr.d_type==QType::MX ||
- d_rr.dr.d_type==QType::NS ||
- d_rr.dr.d_type==QType::SRV))
+ if(i.dr.d_place!=DNSResourceRecord::ADDITIONAL &&
+ (i.dr.d_type==QType::MX ||
+ i.dr.d_type==QType::NS ||
+ i.dr.d_type==QType::SRV))
{
- arrs.push_back(&d_rr);
+ arrs.push_back(&i);
}
}
return arrs;
MOADNSParser mdp(false, p.getString());
// cerr<<"Got completion, "<<mdp.d_answers.size()<<" answers, rcode: "<<mdp.d_header.rcode<<endl;
if (mdp.d_header.rcode == RCode::NoError) {
- for(const auto & d_answer : mdp.d_answers) {
+ for(const auto & answer : mdp.d_answers) {
// cerr<<"comp: "<<(int)j->first.d_place-1<<" "<<j->first.d_label<<" " << DNSRecordContent::NumberToType(j->first.d_type)<<" "<<j->first.d_content->getZoneRepresentation()<<endl;
- if(d_answer.first.d_place == DNSResourceRecord::ANSWER || (d_answer.first.d_place == DNSResourceRecord::AUTHORITY && d_answer.first.d_type == QType::SOA)) {
+ if(answer.first.d_place == DNSResourceRecord::ANSWER || (answer.first.d_place == DNSResourceRecord::AUTHORITY && answer.first.d_type == QType::SOA)) {
- if(d_answer.first.d_type == i->second.qtype || (i->second.qtype == QType::ANY && (d_answer.first.d_type == QType::A || d_answer.first.d_type == QType::AAAA))) {
+ if(answer.first.d_type == i->second.qtype || (i->second.qtype == QType::ANY && (answer.first.d_type == QType::A || answer.first.d_type == QType::AAAA))) {
DNSZoneRecord dzr;
dzr.dr.d_name=i->second.aname;
- dzr.dr.d_type = d_answer.first.d_type;
- dzr.dr.d_ttl=d_answer.first.d_ttl;
- dzr.dr.d_place= d_answer.first.d_place;
- dzr.dr.d_content=d_answer.first.d_content;
+ dzr.dr.d_type = answer.first.d_type;
+ dzr.dr.d_ttl=answer.first.d_ttl;
+ dzr.dr.d_place= answer.first.d_place;
+ dzr.dr.d_content=answer.first.d_content;
i->second.complete->addRecord(std::move(dzr));
}
}
return forwardPacket(msgPrefix, p, di);
// Check if all the records provided are within the zone
- for(const auto & d_answer : mdp.d_answers) {
- const DNSRecord *rr = &d_answer.first;
+ for(const auto & answer : mdp.d_answers) {
+ const DNSRecord *rr = &answer.first;
// Skip this check for other field types (like the TSIG - which is in the additional section)
// For a TSIG, the label is the dnskey, so it does not pass the endOn validation.
if (! (rr->d_place == DNSResourceRecord::ANSWER || rr->d_place == DNSResourceRecord::AUTHORITY))
}
// 3.2.1 and 3.2.2 - Prerequisite check
- for(const auto & d_answer : mdp.d_answers) {
- const DNSRecord *rr = &d_answer.first;
+ for(const auto & answer : mdp.d_answers) {
+ const DNSRecord *rr = &answer.first;
if (rr->d_place == DNSResourceRecord::ANSWER) {
int res = checkUpdatePrerequisites(rr, &di);
if (res>0) {
try {
uint changedRecords = 0;
// 3.4.1 - Prescan section
- for(const auto & d_answer : mdp.d_answers) {
- const DNSRecord *rr = &d_answer.first;
+ for(const auto & answer : mdp.d_answers) {
+ const DNSRecord *rr = &answer.first;
if (rr->d_place == DNSResourceRecord::AUTHORITY) {
int res = checkUpdatePrescan(rr);
if (res>0) {
}
vector<const DNSRecord *> cnamesToAdd, nonCnamesToAdd;
- for(const auto & d_answer : mdp.d_answers) {
- const DNSRecord *rr = &d_answer.first;
+ for(const auto & answer : mdp.d_answers) {
+ const DNSRecord *rr = &answer.first;
if (rr->d_place == DNSResourceRecord::AUTHORITY) {
/* see if it's permitted by policy */
if (this->d_update_policy_lua != nullptr) {
uint32_t serial = 0;
MOADNSParser mdp(false, q->getString());
- for(const auto & d_answer : mdp.d_answers) {
- const DNSRecord *rr = &d_answer.first;
+ for(const auto & answer : mdp.d_answers) {
+ const DNSRecord *rr = &answer.first;
if (rr->d_type == QType::SOA && rr->d_place == DNSResourceRecord::AUTHORITY) {
vector<string>parts;
stringtok(parts, rr->d_content->getZoneRepresentation());