"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "pdns_recursor.cc" between
pdns-recursor-4.5.5.tar.bz2 and pdns-recursor-4.5.6.tar.bz2

About: PowerDNS - a separate release of the PowerDNS Recursor (without the authoritative nameserver).

pdns_recursor.cc  (pdns-recursor-4.5.5.tar.bz2):pdns_recursor.cc  (pdns-recursor-4.5.6.tar.bz2)
skipping to change at line 1327 skipping to change at line 1327
ret = true; ret = true;
} }
} }
return ret; return ret;
} }
static void sendNODLookup(const DNSName& dname) static void sendNODLookup(const DNSName& dname)
{ {
if (!(g_nodLookupDomain.isRoot())) { if (!(g_nodLookupDomain.isRoot())) {
// Send a DNS A query to <domain>.g_nodLookupDomain // Send a DNS A query to <domain>.g_nodLookupDomain
static const QType qt(QType::A);
static const uint16_t qc(QClass::IN);
DNSName qname; DNSName qname;
try { try {
qname = dname + g_nodLookupDomain; qname = dname + g_nodLookupDomain;
} }
catch(const std::range_error &e) { catch(const std::range_error &e) {
++g_stats.nodLookupsDroppedOversize; ++g_stats.nodLookupsDroppedOversize;
return; return;
} }
vector<DNSRecord> dummy; vector<DNSRecord> dummy;
directResolve(qname, qt, qc, dummy, false); directResolve(qname, QType::A, QClass::IN, dummy, nullptr, false);
} }
} }
static bool udrCheckUniqueDNSRecord(const DNSName& dname, uint16_t qtype, const DNSRecord& record) static bool udrCheckUniqueDNSRecord(const DNSName& dname, uint16_t qtype, const DNSRecord& record)
{ {
bool ret = false; bool ret = false;
if (record.d_place == DNSResourceRecord::ANSWER || if (record.d_place == DNSResourceRecord::ANSWER ||
record.d_place == DNSResourceRecord::ADDITIONAL) { record.d_place == DNSResourceRecord::ADDITIONAL) {
// Create a string that represent a triplet of (qname, qtype and RR[type, na me, content]) // Create a string that represent a triplet of (qname, qtype and RR[type, na me, content])
std::stringstream ss; std::stringstream ss;
skipping to change at line 1380 skipping to change at line 1378
target=rec->getTarget(); target=rec->getTarget();
break; break;
} }
} }
} }
if(target.empty()) { if(target.empty()) {
return rcode; return rcode;
} }
rcode = directResolve(target, qtype, QClass::IN, resolved); rcode = directResolve(target, qtype, QClass::IN, resolved, t_pdl);
for(DNSRecord& rr : resolved) { for(DNSRecord& rr : resolved) {
ret.push_back(std::move(rr)); ret.push_back(std::move(rr));
} }
return rcode; return rcode;
} }
int getFakeAAAARecords(const DNSName& qname, ComboAddress prefix, vector<DNSReco rd>& ret) int getFakeAAAARecords(const DNSName& qname, ComboAddress prefix, vector<DNSReco rd>& ret)
{ {
/* we pass a separate vector of records because we will be resolving the initi al qname /* we pass a separate vector of records because we will be resolving the initi al qname
again, possibly encountering the same CNAME(s), and we don't want to trigge r the CNAME again, possibly encountering the same CNAME(s), and we don't want to trigge r the CNAME
loop detection. */ loop detection. */
vector<DNSRecord> newRecords; vector<DNSRecord> newRecords;
int rcode = directResolve(qname, QType(QType::A), QClass::IN, newRecords); int rcode = directResolve(qname, QType::A, QClass::IN, newRecords, t_pdl);
ret.reserve(ret.size() + newRecords.size()); ret.reserve(ret.size() + newRecords.size());
for (auto& record : newRecords) { for (auto& record : newRecords) {
ret.push_back(std::move(record)); ret.push_back(std::move(record));
} }
// Remove double CNAME records // Remove double CNAME records
std::set<DNSName> seenCNAMEs; std::set<DNSName> seenCNAMEs;
ret.erase(std::remove_if( ret.erase(std::remove_if(
ret.begin(), ret.begin(),
skipping to change at line 1474 skipping to change at line 1472
newquery.append(1, '.'); newquery.append(1, '.');
} }
newquery += "in-addr.arpa."; newquery += "in-addr.arpa.";
DNSRecord rr; DNSRecord rr;
rr.d_name = qname; rr.d_name = qname;
rr.d_type = QType::CNAME; rr.d_type = QType::CNAME;
rr.d_content = std::make_shared<CNAMERecordContent>(newquery); rr.d_content = std::make_shared<CNAMERecordContent>(newquery);
ret.push_back(rr); ret.push_back(rr);
int rcode = directResolve(DNSName(newquery), QType(QType::PTR), QClass::IN, re t); int rcode = directResolve(DNSName(newquery), QType::PTR, QClass::IN, ret, t_pd l);
return rcode; return rcode;
} }
static bool answerIsNOData(uint16_t requestedType, int rcode, const std::vector< DNSRecord>& records) static bool answerIsNOData(uint16_t requestedType, int rcode, const std::vector< DNSRecord>& records)
{ {
if (rcode != RCode::NoError) { if (rcode != RCode::NoError) {
return false; return false;
} }
for (const auto& rec : records) { for (const auto& rec : records) {
 End of changes. 5 change blocks. 
6 lines changed or deleted 4 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)