{
bool ret = false;
// First check the (sub)domain isn't ignored for UDR purposes
- if (!g_udrDomainWL.check(dname)) {
- if (record.d_place == DNSResourceRecord::ANSWER || record.d_place == DNSResourceRecord::ADDITIONAL) {
- // Create a string that represent a triplet of (qname, qtype and RR[type, name, content])
- std::stringstream strStream;
- strStream << dname.toDNSStringLC() << ":" << qtype << ":" << qtype << ":" << record.d_type << ":" << record.d_name.toDNSStringLC() << ":" << record.getContent()->getZoneRepresentation();
- if (g_udrDBp && g_udrDBp->isUniqueResponse(strStream.str())) {
- if (g_udrLog) {
- // This should also probably log to a dedicated file.
- SLOG(g_log << Logger::Notice << "Unique response observed: qname=" << dname << " qtype=" << QType(qtype) << " rrtype=" << QType(record.d_type) << " rrname=" << record.d_name << " rrcontent=" << record.getContent()->getZoneRepresentation() << endl,
- nodlogger->info(Logr::Notice, "New response observed",
- "qtype", Logging::Loggable(QType(qtype)),
- "rrtype", Logging::Loggable(QType(record.d_type)),
- "rrname", Logging::Loggable(record.d_name),
- "rrcontent", Logging::Loggable(record.getContent()->getZoneRepresentation())););
- }
- t_Counters.at(rec::Counter::udrCount)++;
- ret = true;
- }
+ if (g_udrDomainWL.check(dname)) {
+ return ret;
+ }
+ if (record.d_place == DNSResourceRecord::ANSWER || record.d_place == DNSResourceRecord::ADDITIONAL) {
+ // Create a string that represent a triplet of (qname, qtype and RR[type, name, content])
+ std::stringstream strStream;
+ strStream << dname.toDNSStringLC() << ":" << qtype << ":" << qtype << ":" << record.d_type << ":" << record.d_name.toDNSStringLC() << ":" << record.getContent()->getZoneRepresentation();
+ if (g_udrDBp && g_udrDBp->isUniqueResponse(strStream.str())) {
+ if (g_udrLog) {
+ // This should also probably log to a dedicated file.
+ SLOG(g_log << Logger::Notice << "Unique response observed: qname=" << dname << " qtype=" << QType(qtype) << " rrtype=" << QType(record.d_type) << " rrname=" << record.d_name << " rrcontent=" << record.getContent()->getZoneRepresentation() << endl,
+ nodlogger->info(Logr::Notice, "New response observed",
+ "qtype", Logging::Loggable(QType(qtype)),
+ "rrtype", Logging::Loggable(QType(record.d_type)),
+ "rrname", Logging::Loggable(record.d_name),
+ "rrcontent", Logging::Loggable(record.getContent()->getZoneRepresentation())););
+ }
+ t_Counters.at(rec::Counter::udrCount)++;
+ ret = true;
}
}
return ret;