BIND 10 trac2314, updated. 0be5967e2ff6364d8d38ad297be99925dfe20cc4 [2314] Changes as a result of the review.
BIND 10 source code commits
bind10-changes at lists.isc.org
Mon Jan 21 17:31:37 UTC 2013
The branch, trac2314 has been updated
via 0be5967e2ff6364d8d38ad297be99925dfe20cc4 (commit)
from 3886d1174c6552cc99c3d5fa2c727c3ee0bcc281 (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 0be5967e2ff6364d8d38ad297be99925dfe20cc4
Author: Marcin Siodelski <marcin at isc.org>
Date: Mon Jan 21 18:31:01 2013 +0100
[2314] Changes as a result of the review.
-----------------------------------------------------------------------
Summary of changes:
src/bin/dhcp4/config_parser.cc | 9 ++++-----
src/bin/dhcp6/config_parser.cc | 9 ++++-----
src/lib/dhcp/option_custom.h | 2 +-
src/lib/dhcp/option_definition.cc | 11 +++++------
src/lib/dhcp/option_definition.h | 4 ++--
src/lib/dhcp/tests/libdhcp++_unittest.cc | 2 +-
src/lib/dhcp/tests/option_definition_unittest.cc | 2 +-
7 files changed, 18 insertions(+), 21 deletions(-)
-----------------------------------------------------------------------
diff --git a/src/bin/dhcp4/config_parser.cc b/src/bin/dhcp4/config_parser.cc
index 71d0412..e6fcf7b 100644
--- a/src/bin/dhcp4/config_parser.cc
+++ b/src/bin/dhcp4/config_parser.cc
@@ -1366,10 +1366,9 @@ private:
/// @param option_space a name of the encapsulated option space.
/// @param option option instance to append sub-options to.
void appendSubOptions(const std::string& option_space, OptionPtr& option) {
- // If invalid pointer there is nothing to do.
- if (!option) {
- return;
- }
+ // Only non-NULL options are stored in option container.
+ // If this option pointer is NULL this is a serious error.
+ assert(option);
OptionDefinitionPtr def;
if (option_space == "dhcp4" &&
@@ -1398,7 +1397,7 @@ private:
assert(def);
}
- // We need to get option definition fo the particular option space
+ // We need to get option definition for the particular option space
// and code. This definition holds the information whether our
// option encapsulates any option space.
// Get the encapsulated option space name.
diff --git a/src/bin/dhcp6/config_parser.cc b/src/bin/dhcp6/config_parser.cc
index a29a003..46698c3 100644
--- a/src/bin/dhcp6/config_parser.cc
+++ b/src/bin/dhcp6/config_parser.cc
@@ -1391,10 +1391,9 @@ private:
/// @param option_space a name of the encapsulated option space.
/// @param option option instance to append sub-options to.
void appendSubOptions(const std::string& option_space, OptionPtr& option) {
- // If invalid pointer there is nothing to do.
- if (!option) {
- return;
- }
+ // Only non-NULL options are stored in option container.
+ // If this option pointer is NULL this is a serious error.
+ assert(option);
OptionDefinitionPtr def;
if (option_space == "dhcp6" &&
@@ -1423,7 +1422,7 @@ private:
assert(def);
}
- // We need to get option definition fo the particular option space
+ // We need to get option definition for the particular option space
// and code. This definition holds the information whether our
// option encapsulates any option space.
// Get the encapsulated option space name.
diff --git a/src/lib/dhcp/option_custom.h b/src/lib/dhcp/option_custom.h
index 7d3c5db..efb59ab 100644
--- a/src/lib/dhcp/option_custom.h
+++ b/src/lib/dhcp/option_custom.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2012 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2012-2013 Internet Systems Consortium, Inc. ("ISC")
//
// Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
diff --git a/src/lib/dhcp/option_definition.cc b/src/lib/dhcp/option_definition.cc
index 03583ac..a1e396e 100644
--- a/src/lib/dhcp/option_definition.cc
+++ b/src/lib/dhcp/option_definition.cc
@@ -1,4 +1,4 @@
-// Copyright (C) 2012 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2012-2013 Internet Systems Consortium, Inc. ("ISC")
//
// Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
@@ -66,13 +66,12 @@ OptionDefinition::OptionDefinition(const std::string& name,
const char* encapsulated_space)
: name_(name),
code_(code),
- type_(OPT_UNKNOWN_TYPE),
+ // Data type is held as enum value by this class.
+ // Use the provided option type string to get the
+ // corresponding enum value.
+ type_(OptionDataTypeUtil::getDataType(type)),
array_type_(false),
encapsulated_space_(encapsulated_space) {
- // Data type is held as enum value by this class.
- // Use the provided option type string to get the
- // corresponding enum value.
- type_ = OptionDataTypeUtil::getDataType(type);
}
OptionDefinition::OptionDefinition(const std::string& name,
diff --git a/src/lib/dhcp/option_definition.h b/src/lib/dhcp/option_definition.h
index 5f127f0..df5def7 100644
--- a/src/lib/dhcp/option_definition.h
+++ b/src/lib/dhcp/option_definition.h
@@ -234,14 +234,14 @@ public:
/// @brief Return name of the encapsulated option space.
///
/// @return name of the encapsulated option space.
- const std::string& getEncapsulatedSpace() const {
+ std::string getEncapsulatedSpace() const {
return (encapsulated_space_);
}
/// @brief Return option name.
///
/// @return option name.
- const std::string& getName() const { return (name_); }
+ std::string getName() const { return (name_); }
/// @brief Return list of record fields.
///
diff --git a/src/lib/dhcp/tests/libdhcp++_unittest.cc b/src/lib/dhcp/tests/libdhcp++_unittest.cc
index 7ec2210..44b5cbe 100644
--- a/src/lib/dhcp/tests/libdhcp++_unittest.cc
+++ b/src/lib/dhcp/tests/libdhcp++_unittest.cc
@@ -1,4 +1,4 @@
-// Copyright (C) 2011-2012 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2011-2013 Internet Systems Consortium, Inc. ("ISC")
//
// Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
diff --git a/src/lib/dhcp/tests/option_definition_unittest.cc b/src/lib/dhcp/tests/option_definition_unittest.cc
index 704d42f..174bafb 100644
--- a/src/lib/dhcp/tests/option_definition_unittest.cc
+++ b/src/lib/dhcp/tests/option_definition_unittest.cc
@@ -1,4 +1,4 @@
-// Copyright (C) 2012 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2012-2013 Internet Systems Consortium, Inc. ("ISC")
//
// Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
More information about the bind10-changes
mailing list