BIND 10 trac1750, updated. ed2d49029b003ba8dab938ba015270a17f4b203c [1750] Implement calling with the hint

BIND 10 source code commits bind10-changes at lists.isc.org
Mon Mar 12 17:53:20 UTC 2012


The branch, trac1750 has been updated
       via  ed2d49029b003ba8dab938ba015270a17f4b203c (commit)
       via  a44afd187fe7f280900caac89ebb84c48813082d (commit)
       via  7607badc99b36d26fde9866f960f65e575309f27 (commit)
      from  85885d88d2647bb4bac08c0f25f485659a4e9320 (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 ed2d49029b003ba8dab938ba015270a17f4b203c
Author: Michal 'vorner' Vaner <michal.vaner at nic.cz>
Date:   Mon Mar 12 18:38:38 2012 +0100

    [1750] Implement calling with the hint

commit a44afd187fe7f280900caac89ebb84c48813082d
Author: Michal 'vorner' Vaner <michal.vaner at nic.cz>
Date:   Mon Mar 12 18:14:46 2012 +0100

    [1750] Make sure it is present usually
    
    Blacklisting the check when the implementation is done, to find the
    relevant tests and check they really should not check, instead of
    reading the whole file.

commit 7607badc99b36d26fde9866f960f65e575309f27
Author: Michal 'vorner' Vaner <michal.vaner at nic.cz>
Date:   Mon Mar 12 18:11:15 2012 +0100

    [1750] Make sure the hint is present only at origin

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

Summary of changes:
 src/bin/auth/query.cc                |    6 ++++--
 src/bin/auth/tests/query_unittest.cc |   22 +++++++++++++++++++++-
 2 files changed, 25 insertions(+), 3 deletions(-)

-----------------------------------------------------------------------
diff --git a/src/bin/auth/query.cc b/src/bin/auth/query.cc
index 7d50393..0f2437a 100644
--- a/src/bin/auth/query.cc
+++ b/src/bin/auth/query.cc
@@ -93,7 +93,8 @@ namespace auth {
 void
 Query::addSOA(ZoneFinder& finder) {
     ZoneFinderContextPtr soa_ctx = finder.find(finder.getOrigin(),
-                                               RRType::SOA(), dnssec_opt_);
+                                               RRType::SOA(), dnssec_opt_ |
+                                               ZoneFinder::FIND_AT_ORIGIN);
     if (soa_ctx->code != ZoneFinder::SUCCESS) {
         isc_throw(NoSOA, "There's no SOA record in zone " <<
             finder.getOrigin().toText());
@@ -347,7 +348,8 @@ Query::addAuthAdditional(ZoneFinder& finder,
 
     // Fill in authority and addtional sections.
     ConstZoneFinderContextPtr ns_context = finder.find(origin, RRType::NS(),
-                                                       dnssec_opt_);
+                                                       dnssec_opt_ |
+         ZoneFinder::FIND_AT_ORIGIN);
 
     // zone origin name should have NS records
     if (ns_context->code != ZoneFinder::SUCCESS) {
diff --git a/src/bin/auth/tests/query_unittest.cc b/src/bin/auth/tests/query_unittest.cc
index 3c901aa..d6bdae8 100644
--- a/src/bin/auth/tests/query_unittest.cc
+++ b/src/bin/auth/tests/query_unittest.cc
@@ -295,7 +295,8 @@ public:
         use_nsec3_(false),
         nsec_name_(origin_),
         nsec3_fake_(NULL),
-        nsec3_name_(NULL)
+        nsec3_name_(NULL),
+        skip_find_at_origin_check_(false)
     {
         stringstream zone_stream;
         zone_stream << soa_txt << zone_ns_txt << ns_addrs_txt <<
@@ -529,6 +530,11 @@ private:
 public:
     // Public, to allow tests looking up the right names for something
     map<Name, string> hash_map_;
+    // Should we skip checking the optimisation flag FIND_AT_ORIGIN is
+    // present if a query for origi comes? It might be useful when doing
+    // a real query against the origin - then the first find would not
+    // have it.
+    bool skip_find_at_origin_check_;
 };
 
 // A helper function that generates a new RRset based on "wild_rrset",
@@ -633,6 +639,12 @@ ZoneFinderContextPtr
 MockZoneFinder::find(const Name& name, const RRType& type,
                      const FindOptions options)
 {
+    EXPECT_TRUE(name == origin_ || !(options & FIND_AT_ORIGIN)) <<
+        "The FIND_AT_ORIGIN optimisation hint provided when not searching "
+        "origin";
+
+    EXPECT_TRUE(name != origin_ || options & FIND_AT_ORIGIN ||
+                skip_find_at_origin_check_);
     // Emulating a broken zone: mandatory apex RRs are missing if specifically
     // configured so (which are rare cases).
     if (name == origin_ && type == RRType::SOA() && !has_SOA_) {
@@ -1003,6 +1015,8 @@ TEST_F(QueryTest, exactAddrMatch) {
 TEST_F(QueryTest, apexNSMatch) {
     // find match rrset, omit authority data which has already been provided
     // in the answer section from the authority section.
+    mock_finder->skip_find_at_origin_check_ = true; // Querying the origin
+                                                    // directly
     EXPECT_NO_THROW(Query(memory_client, Name("example.com"), RRType::NS(),
                           response).process());
 
@@ -1028,6 +1042,8 @@ TEST_F(QueryTest, exactAnyMatch) {
 TEST_F(QueryTest, apexAnyMatch) {
     // find match rrset, omit additional data which has already been provided
     // in the answer section from the additional.
+    mock_finder->skip_find_at_origin_check_ = true; // Querying the origin
+                                                    // directly
     EXPECT_NO_THROW(Query(memory_client, Name("example.com"),
                           RRType::ANY(), response).process());
     responseCheck(response, Rcode::NOERROR(), AA_FLAG, 5, 0, 3,
@@ -2079,6 +2095,8 @@ TEST_F(QueryTest, dsAboveDelegationNoData) {
 // when it happens to be sent to the child zone, as described in RFC 4035,
 // section 3.1.4.1. The example is inspired by the B.8. example from the RFC.
 TEST_F(QueryTest, dsBelowDelegation) {
+    mock_finder->skip_find_at_origin_check_ = true; // Querying the origin
+                                                    // directly
     EXPECT_NO_THROW(Query(memory_client, Name("example.com"),
                           RRType::DS(), response, true).process());
 
@@ -2095,6 +2113,8 @@ TEST_F(QueryTest, dsBelowDelegation) {
 // exists in the child zone.  The Query module should still return SOA.
 // In our implementation NSEC/NSEC3 isn't attached in this case.
 TEST_F(QueryTest, dsBelowDelegationWithDS) {
+    mock_finder->skip_find_at_origin_check_ = true; // Querying the origin
+                                                    // directly
     mock_finder->addRecord(zone_ds_txt); // add the DS to the child's apex
     EXPECT_NO_THROW(Query(memory_client, Name("example.com"),
                           RRType::DS(), response, true).process());



More information about the bind10-changes mailing list