BIND 10 trac871, updated. 31a6f34026c83594bd9f205df18eb290114d9ea1 [trac871] corrected the record length calculation (forgot to count RDLEN)

BIND 10 source code commits bind10-changes at lists.isc.org
Sat Apr 30 05:55:57 UTC 2011


The branch, trac871 has been updated
       via  31a6f34026c83594bd9f205df18eb290114d9ea1 (commit)
      from  b8422db8e0120d3998b15581dddcbfe4efe91a68 (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 31a6f34026c83594bd9f205df18eb290114d9ea1
Author: JINMEI Tatuya <jinmei at isc.org>
Date:   Fri Apr 29 22:54:59 2011 -0700

    [trac871] corrected the record length calculation (forgot to count RDLEN)

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

Summary of changes:
 src/lib/dns/tests/tsigrecord_unittest.cc |   12 ++++++------
 src/lib/dns/tsigrecord.cc                |    4 ++--
 2 files changed, 8 insertions(+), 8 deletions(-)

-----------------------------------------------------------------------
diff --git a/src/lib/dns/tests/tsigrecord_unittest.cc b/src/lib/dns/tests/tsigrecord_unittest.cc
index c2fec9c..1610df1 100644
--- a/src/lib/dns/tests/tsigrecord_unittest.cc
+++ b/src/lib/dns/tests/tsigrecord_unittest.cc
@@ -58,12 +58,12 @@ TEST_F(TSIGRecordTest, getName) {
 }
 
 TEST_F(TSIGRecordTest, getLength) {
-    // 83 = 17 + 26 + 16 + 24
+    // 85 = 17 + 26 + 16 + 24
     // len(www.example.com) = 17
     // len(hmac-md5.sig-alg.reg.int) = 26
     // len(MAC) = 16
-    // the rest are fixed length fields (24 in total)
-    EXPECT_EQ(83, test_record.getLength());
+    // the rest are fixed length fields (26 in total)
+    EXPECT_EQ(85, test_record.getLength());
 }
 
 TEST_F(TSIGRecordTest, recordToWire) {
@@ -82,10 +82,10 @@ TEST_F(TSIGRecordTest, recordToWire) {
 }
 
 TEST_F(TSIGRecordTest, recordToOLongToWire) {
-    // Rendering the test record requires a room of 83 bytes (see the
-    // getLength test).  By setting the limit to 82, it will fail, and
+    // Rendering the test record requires a room of 85 bytes (see the
+    // getLength test).  By setting the limit to 84, it will fail, and
     // the renderer will be marked as "truncated".
-    renderer.setLengthLimit(82);
+    renderer.setLengthLimit(84);
     EXPECT_FALSE(renderer.isTruncated()); // not marked before render attempt
     EXPECT_EQ(0, test_record.toWire(renderer));
     EXPECT_TRUE(renderer.isTruncated());
diff --git a/src/lib/dns/tsigrecord.cc b/src/lib/dns/tsigrecord.cc
index f767dff..503ee2c 100644
--- a/src/lib/dns/tsigrecord.cc
+++ b/src/lib/dns/tsigrecord.cc
@@ -27,8 +27,8 @@ using namespace isc::util;
 namespace {
 // Internally used constants:
 
-// Size in octets for the RR type, class TTL fields.
-const size_t RR_COMMON_LEN = 8;
+// Size in octets for the RR type, class TTL, RDLEN fields.
+const size_t RR_COMMON_LEN = 10;
 
 // Size in octets for the fixed part of TSIG RDATAs.
 // - Time Signed (6)




More information about the bind10-changes mailing list