BIND 10 trac2390_2, updated. 814eb8ad33d8f85621d3daacd4c64c4d7e3dc43d [2390] Check that origin argument is used for relative names
BIND 10 source code commits
bind10-changes at lists.isc.org
Thu Jan 31 00:23:41 UTC 2013
The branch, trac2390_2 has been updated
via 814eb8ad33d8f85621d3daacd4c64c4d7e3dc43d (commit)
via 11f5ae7cddca20ae003331cd69b817be4aea790c (commit)
from bc42c4b3d31ed960581808d76e7150e0fc3eb1d9 (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 814eb8ad33d8f85621d3daacd4c64c4d7e3dc43d
Author: Mukund Sivaraman <muks at isc.org>
Date: Thu Jan 31 05:52:55 2013 +0530
[2390] Check that origin argument is used for relative names
commit 11f5ae7cddca20ae003331cd69b817be4aea790c
Author: Mukund Sivaraman <muks at isc.org>
Date: Thu Jan 31 05:46:15 2013 +0530
[2390] Include bad data in the exception message
-----------------------------------------------------------------------
Summary of changes:
src/lib/dns/rdata/generic/mx_15.cc | 5 +++--
src/lib/dns/tests/rdata_mx_unittest.cc | 6 ++++++
src/lib/dns/tests/rdata_ns_unittest.cc | 6 ++++++
src/lib/dns/tests/rdata_ptr_unittest.cc | 7 +++++++
4 files changed, 22 insertions(+), 2 deletions(-)
-----------------------------------------------------------------------
diff --git a/src/lib/dns/rdata/generic/mx_15.cc b/src/lib/dns/rdata/generic/mx_15.cc
index c2001ca..f306870 100644
--- a/src/lib/dns/rdata/generic/mx_15.cc
+++ b/src/lib/dns/rdata/generic/mx_15.cc
@@ -70,7 +70,8 @@ MX::MX(const std::string& mx_str) :
const uint32_t num =
lexer.getNextToken(MasterToken::NUMBER).getNumber();
if (num > 65535) {
- isc_throw(InvalidRdataText, "Invalid MX preference");
+ isc_throw(InvalidRdataText, "Invalid MX preference in: "
+ << mx_str);
}
preference_ = static_cast<uint16_t>(num);
@@ -110,7 +111,7 @@ MX::MX(MasterLexer& lexer, const Name* origin,
{
const uint32_t num = lexer.getNextToken(MasterToken::NUMBER).getNumber();
if (num > 65535) {
- isc_throw(InvalidRdataText, "Invalid MX preference");
+ isc_throw(InvalidRdataText, "Invalid MX preference: " << num);
}
preference_ = static_cast<uint16_t>(num);
diff --git a/src/lib/dns/tests/rdata_mx_unittest.cc b/src/lib/dns/tests/rdata_mx_unittest.cc
index 475f65b..f4d0abb 100644
--- a/src/lib/dns/tests/rdata_mx_unittest.cc
+++ b/src/lib/dns/tests/rdata_mx_unittest.cc
@@ -73,6 +73,12 @@ TEST_F(Rdata_MX_Test, createFromLexer) {
*test::createRdataUsingLexer(RRType::MX(), RRClass::IN(),
"10 mx.example.com.")));
+ // test::createRdataUsingLexer() constructs relative to
+ // "example.org." origin.
+ EXPECT_EQ(0, generic::MX("10 mx2.example.org.").compare(
+ *test::createRdataUsingLexer(RRType::MX(), RRClass::IN(),
+ "10 mx2")));
+
// Exceptions cause NULL to be returned.
EXPECT_FALSE(test::createRdataUsingLexer(RRType::MX(), RRClass::IN(),
"10 mx. example.com."));
diff --git a/src/lib/dns/tests/rdata_ns_unittest.cc b/src/lib/dns/tests/rdata_ns_unittest.cc
index 980b56c..a6f5a98 100644
--- a/src/lib/dns/tests/rdata_ns_unittest.cc
+++ b/src/lib/dns/tests/rdata_ns_unittest.cc
@@ -96,6 +96,12 @@ TEST_F(Rdata_NS_Test, createFromLexer) {
*test::createRdataUsingLexer(RRType::NS(), RRClass::IN(),
"ns.example.com.")));
+ // test::createRdataUsingLexer() constructs relative to
+ // "example.org." origin.
+ EXPECT_EQ(0, generic::NS("ns8.example.org.").compare(
+ *test::createRdataUsingLexer(RRType::NS(), RRClass::IN(),
+ "ns8")));
+
// Exceptions cause NULL to be returned.
EXPECT_FALSE(test::createRdataUsingLexer(RRType::NS(), RRClass::IN(),
""));
diff --git a/src/lib/dns/tests/rdata_ptr_unittest.cc b/src/lib/dns/tests/rdata_ptr_unittest.cc
index 4da26df..9378c5e 100644
--- a/src/lib/dns/tests/rdata_ptr_unittest.cc
+++ b/src/lib/dns/tests/rdata_ptr_unittest.cc
@@ -99,6 +99,13 @@ TEST_F(Rdata_PTR_Test, createFromLexer) {
EXPECT_EQ(0, rdata_ptr.compare(
*test::createRdataUsingLexer(RRType::PTR(), RRClass::IN(),
"ns.example.com.")));
+
+ // test::createRdataUsingLexer() constructs relative to
+ // "example.org." origin.
+ EXPECT_EQ(0, generic::PTR("foo0.example.org.").compare(
+ *test::createRdataUsingLexer(RRType::PTR(), RRClass::IN(),
+ "foo0")));
+
// Extra text at end of line
EXPECT_FALSE(test::createRdataUsingLexer(RRType::PTR(), RRClass::IN(),
"foo.example.com. extra."));
More information about the bind10-changes
mailing list