BIND 10 trac3180, updated. 36eabc93eddd0eaf89ba2a5c29cf802bab4ad9e0 [3180] Addressed additional review comments.
BIND 10 source code commits
bind10-changes at lists.isc.org
Thu Oct 10 10:48:32 UTC 2013
The branch, trac3180 has been updated
via 36eabc93eddd0eaf89ba2a5c29cf802bab4ad9e0 (commit)
from c71753a27a64d409f28629f308dfe9f7afb7e0ae (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 36eabc93eddd0eaf89ba2a5c29cf802bab4ad9e0
Author: Marcin Siodelski <marcin at isc.org>
Date: Thu Oct 10 12:48:11 2013 +0200
[3180] Addressed additional review comments.
-----------------------------------------------------------------------
Summary of changes:
src/lib/dhcp/pkt6.cc | 2 +-
src/lib/dhcp/tests/option_unittest.cc | 2 ++
src/lib/dhcp/tests/pkt6_unittest.cc | 13 +++++++++++++
3 files changed, 16 insertions(+), 1 deletion(-)
-----------------------------------------------------------------------
diff --git a/src/lib/dhcp/pkt6.cc b/src/lib/dhcp/pkt6.cc
index c4dcfbb..9d194a5 100644
--- a/src/lib/dhcp/pkt6.cc
+++ b/src/lib/dhcp/pkt6.cc
@@ -333,7 +333,7 @@ Pkt6::unpackMsg(OptionBuffer::const_iterator begin,
// The last two arguments hold the DHCPv6 Relay message offset and
// length. Setting them to NULL because we are dealing with the
// not-relayed message.
- callback_(opt_buffer, "dhcp6", options_, 0, 0);
+ callback_(opt_buffer, "dhcp6", options_, NULL, NULL);
}
} catch (const Exception& e) {
// @todo: throw exception here once we turn this function to void.
diff --git a/src/lib/dhcp/tests/option_unittest.cc b/src/lib/dhcp/tests/option_unittest.cc
index 5dbc3eb..3a47d0e 100644
--- a/src/lib/dhcp/tests/option_unittest.cc
+++ b/src/lib/dhcp/tests/option_unittest.cc
@@ -608,6 +608,8 @@ TEST_F(OptionTest, unpackCallback) {
// Parameters from _1 to _5 are placeholders for the actual values
// to be passed to the callback function. See: boost::bind documentation
// at http://www.boost.org/doc/libs/1_54_0/libs/bind/bind.html.
+ // Also, see UnpackOptionsCallback in option.h for description of the
+ // parameter values.
option.setCallback(boost::bind(&CustomUnpackCallback::execute, &cb,
_1, _2, _3, _4, _5));
// Parse options. It should result in a call to our callback function.
diff --git a/src/lib/dhcp/tests/pkt6_unittest.cc b/src/lib/dhcp/tests/pkt6_unittest.cc
index 9d69168..0687321 100644
--- a/src/lib/dhcp/tests/pkt6_unittest.cc
+++ b/src/lib/dhcp/tests/pkt6_unittest.cc
@@ -108,6 +108,19 @@ public:
}
/// @brief Create a wire representation of the test packet and clone it.
+ ///
+ /// The purpose of this function is to create a packet to be used to
+ /// check that packet parsing works correctly. The unpack() function
+ /// requires that the data_ field of the object holds the data to be
+ /// parsed. This function creates an on-wire representation of the
+ /// packet by calling pack(). But, the pack() function stores the
+ /// on-wire representation into the output buffer (not the data_ field).
+ /// For this reason, it is not enough to return the packet on which
+ /// pack() is called. This function returns a clone of this packet
+ /// which is created using a constructor taking a buffer and buffer
+ /// length as an input. This constructor is normally used to parse
+ /// received packets. It stores the packet in a data_ field and
+ /// therefore unpack() can be called to parse it.
Pkt6Ptr packAndClone() {
Pkt6Ptr parent(new Pkt6(DHCPV6_SOLICIT, 0x020304));
More information about the bind10-changes
mailing list