BIND 10 trac744, updated. ea1f2d6e96715f0821df5d096be46b2454e6073a [trac744] Part of messages for data_source.cc

BIND 10 source code commits bind10-changes at lists.isc.org
Thu Apr 28 16:10:09 UTC 2011


The branch, trac744 has been updated
       via  ea1f2d6e96715f0821df5d096be46b2454e6073a (commit)
      from  1151e49bcec0ac69fe01d084e10f106481337dea (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit ea1f2d6e96715f0821df5d096be46b2454e6073a
Author: Michal 'vorner' Vaner <michal.vaner at nic.cz>
Date:   Thu Apr 28 18:09:12 2011 +0200

    [trac744] Part of messages for data_source.cc

-----------------------------------------------------------------------

Summary of changes:
 src/lib/datasrc/data_source.cc |   27 ++++++++++++++++++++++++++-
 src/lib/datasrc/messagedef.mes |   34 ++++++++++++++++++++++++++++++++++
 2 files changed, 60 insertions(+), 1 deletions(-)

-----------------------------------------------------------------------
diff --git a/src/lib/datasrc/data_source.cc b/src/lib/datasrc/data_source.cc
index 548a811..db06db9 100644
--- a/src/lib/datasrc/data_source.cc
+++ b/src/lib/datasrc/data_source.cc
@@ -25,6 +25,7 @@
 #include <datasrc/cache.h>
 #include <datasrc/data_source.h>
 #include <datasrc/query.h>
+#include <datasrc/logger.h>
 
 #include <util/encode/base32hex.h>
 #include <util/hash/sha1.h>
@@ -83,7 +84,7 @@ class ZoneInfo {
 public:
     ZoneInfo(DataSrc* ts,
              const isc::dns::Name& n,
-             const isc::dns::RRClass& c, 
+             const isc::dns::RRClass& c,
              const isc::dns::RRType& t = isc::dns::RRType::ANY()) :
         top_source_(ts),
         dsm_(((t == RRType::DS() && n.getLabelCount() != 1)
@@ -123,6 +124,11 @@ getAdditional(Query& q, ConstRRsetPtr rrset) {
         const Rdata& rd(it->getCurrent());
         if (rrset->getType() == RRType::NS()) {
             const generic::NS& ns = dynamic_cast<const generic::NS&>(rd);
+            if (logger.isDebugEnabled(DBG_TRACE_DATA)) {
+                logger.debug(DBG_TRACE_DATA, DATASRC_QUERY_GET_NS_ADDITIONAL,
+                             ns.getNSName().toText().c_str(),
+                             rrset->getName().toText().c_str());
+            }
             q.tasks().push(QueryTaskPtr(
                                new QueryTask(q, ns.getNSName(),
                                              Message::SECTION_ADDITIONAL,
@@ -130,6 +136,11 @@ getAdditional(Query& q, ConstRRsetPtr rrset) {
                                              QueryTask::GETADDITIONAL)));
         } else if (rrset->getType() == RRType::MX()) {
             const generic::MX& mx = dynamic_cast<const generic::MX&>(rd);
+            if (logger.isDebugEnabled(DBG_TRACE_DATA)) {
+                logger.debug(DBG_TRACE_DATA, DATASRC_QUERY_GET_MX_ADDITIONAL,
+                             mx.getMXName().toText().c_str(),
+                             rrset->getName().toText().c_str());
+            }
             q.tasks().push(QueryTaskPtr(
                                new QueryTask(q, mx.getMXName(),
                                              Message::SECTION_ADDITIONAL,
@@ -143,11 +154,17 @@ getAdditional(Query& q, ConstRRsetPtr rrset) {
 // understand DNAME
 void
 synthesizeCname(QueryTaskPtr task, RRsetPtr rrset, RRsetList& target) {
+    if (logger.isDebugEnabled(DBG_TRACE_DATA)) {
+        logger.debug(DBG_TRACE_DATA, DATASRC_QUERY_SYNTH_CNAME,
+                     rrset->getName().toText().c_str());
+    }
     RdataIteratorPtr it = rrset->getRdataIterator();
 
     // More than one DNAME RR in the RRset is illegal, so we only have
     // to process the first one.
     if (it->isLast()) {
+        logger.error(DATASRC_QUERY_EMPTY_DNAME,
+                     rrset->getName().toText().c_str());
         return;
     }
 
@@ -171,16 +188,24 @@ synthesizeCname(QueryTaskPtr task, RRsetPtr rrset, RRsetList& target) {
 // to by a CNAME record
 void
 chaseCname(Query& q, QueryTaskPtr task, RRsetPtr rrset) {
+    if (logger.isDebugEnabled(DBG_TRACE_DATA)) {
+        logger.debug(DBG_TRACE_DATA, DATASRC_QUERY_FOLLOW_CNAME,
+                     rrset->getName().toText().c_str());
+    }
     RdataIteratorPtr it = rrset->getRdataIterator();
 
     // More than one CNAME RR in the RRset is illegal, so we only have
     // to process the first one.
     if (it->isLast()) {
+        logger.error(DATASRC_QUERY_EMPTY_CNAME,
+                     rrset->getName().toText().c_str());
         return;
     }
 
     // Stop chasing CNAMES after 16 lookups, to prevent loops
     if (q.tooMany()) {
+        logger.error(DATASRC_QUERY_TOO_MANY_CNAMES,
+                     rrset->getName().toText().c_str());
         return;
     }
 
diff --git a/src/lib/datasrc/messagedef.mes b/src/lib/datasrc/messagedef.mes
index 85ee093..821f2e7 100644
--- a/src/lib/datasrc/messagedef.mes
+++ b/src/lib/datasrc/messagedef.mes
@@ -68,3 +68,37 @@ CACHE_ENABLE Enabling the cache
 CACHE_DISABLE Disabling the cache
 + The hotspot cache is disabled from now on. It is not going to store
 + information or return anything.
+
+QUERY_SYNTH_CNAME Synthesizing CNAME from DNAME on '%s'
++ Debug info. While answering a query, we met a DNAME. We'll return the DNAME,
++ but we're creating a CNAME for clients that don't understand DNAMEs.
+
+QUERY_EMPTY_DNAME The DNAME on '%s' is empty
++ We tried to synthesize a CNAME from this DNAME, but it contains no records.
++ This indicates problem with supplied data.
+
+QUERY_GET_NS_ADDITIONAL Addition of A/AAAA for '%s' requested by NS '%s'
++ Debug information. While processing a query, we met a NS record. It
++ references the mentioned address, so we want to look up A/AAAA records for it
++ and put it into the additional section.
+
+QUERY_GET_MX_ADDITIONAL Addition of A/AAAA for '%s' requested by MX '%s'
++ Debug information. While processing a query, we met a MX record. It
++ references the mentioned address, so we want to look up A/AAAA records for it
++ and put it into the additional section.
+
+QUERY_FOLLOW_CNAME Following CNAME at '%s'
++ Debug information. The domain is a CNAME (or a DNAME and we created a CNAME
++ for it already), so we're following it.
+
+QUERY_EMPTY_CNAME CNAME at '%s' is empty
++ We tried to follow a CNAME, but contains no records. We have nothing to
++ follow, so we will have nothing in the answer. This indicates a problem with
++ supplied data.
+
+QUERY_TOO_MANY_CNAMES CNAME chain limit exceeded at '%s'
++ While answering a query, we followed a CNAME. Then another one. And after 16
++ CNAMEs we decided it's enough and we won't follow more. Long CNAME chains
++ are discouraged, and this might be a loop as well. Note that some of the
++ CNAMEs might have been synthesised from DNAMEs internally. This indicates
++ a problem with supplied data.




More information about the bind10-changes mailing list