BIND 10 trac2355, updated. 2df5585f42f1af03b89204c7cc22569720a26ae4 [2355] Cleaned up some minor issues spotted in review.

BIND 10 source code commits bind10-changes at lists.isc.org
Mon May 13 20:08:20 UTC 2013


The branch, trac2355 has been updated
       via  2df5585f42f1af03b89204c7cc22569720a26ae4 (commit)
      from  36f7b7fa7bddd07da90c9346d5d62dbed77c2a49 (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 2df5585f42f1af03b89204c7cc22569720a26ae4
Author: Thomas Markwalder <tmark at isc.org>
Date:   Mon May 13 16:07:02 2013 -0400

    [2355] Cleaned up some minor issues spotted in review.

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

Summary of changes:
 src/bin/dhcp4/config_parser.cc                |    3 +--
 src/bin/dhcp4/config_parser.h                 |    4 ++--
 src/bin/dhcp4/tests/config_parser_unittest.cc |    4 ----
 src/bin/dhcp6/config_parser.cc                |    5 ++---
 src/bin/dhcp6/config_parser.h                 |    4 ++--
 src/lib/dhcpsrv/dhcp_parsers.cc               |   23 ++++++++++++-----------
 src/lib/dhcpsrv/tests/cfgmgr_unittest.cc      |    2 +-
 7 files changed, 20 insertions(+), 25 deletions(-)

-----------------------------------------------------------------------
diff --git a/src/bin/dhcp4/config_parser.cc b/src/bin/dhcp4/config_parser.cc
index e7eb93b..f30ff21 100644
--- a/src/bin/dhcp4/config_parser.cc
+++ b/src/bin/dhcp4/config_parser.cc
@@ -155,7 +155,6 @@ public:
     /// @brief Constructor
     ///
     /// @param ignored first parameter
-    /// @param global_context is a pointer to the global context which 
     /// stores global scope parameters, options, option defintions.
     Subnet4ConfigParser(const std::string&)
         :SubnetConfigParser("", globalContext()) {
@@ -512,7 +511,7 @@ configureDhcp4Server(Dhcpv4Srv&, isc::data::ConstElementPtr config_set) {
     return (answer);
 }
 
-ParserContextPtr globalContext() {
+ParserContextPtr& globalContext() {
     static ParserContextPtr global_context_ptr(new ParserContext(Option::V4));
     return (global_context_ptr);
 }
diff --git a/src/bin/dhcp4/config_parser.h b/src/bin/dhcp4/config_parser.h
index 692a908..ea84cc6 100644
--- a/src/bin/dhcp4/config_parser.h
+++ b/src/bin/dhcp4/config_parser.h
@@ -63,8 +63,8 @@ configureDhcp4Server(Dhcpv4Srv&,
 
 /// @brief Returns the global context
 ///
-/// @return a const reference to the global context
-ParserContextPtr globalContext();
+/// @return a reference to the global context
+ParserContextPtr& globalContext();
 
 }; // end of isc::dhcp namespace
 }; // end of isc namespace
diff --git a/src/bin/dhcp4/tests/config_parser_unittest.cc b/src/bin/dhcp4/tests/config_parser_unittest.cc
index 171f431..964e08e 100644
--- a/src/bin/dhcp4/tests/config_parser_unittest.cc
+++ b/src/bin/dhcp4/tests/config_parser_unittest.cc
@@ -53,11 +53,7 @@ public:
     // Checks if global parameter of name have expected_value
     void checkGlobalUint32(string name, uint32_t expected_value) {
         const Uint32StoragePtr uint32_defaults = 
-#if 0
-                                        getGlobalParserContext().uint32_values_;
-#else
                                         globalContext()->uint32_values_;
-#endif
         try {
             uint32_t actual_value = uint32_defaults->getParam(name);
             EXPECT_EQ(expected_value, actual_value);
diff --git a/src/bin/dhcp6/config_parser.cc b/src/bin/dhcp6/config_parser.cc
index f50c733..2d73325 100644
--- a/src/bin/dhcp6/config_parser.cc
+++ b/src/bin/dhcp6/config_parser.cc
@@ -177,7 +177,6 @@ public:
     /// @brief Constructor
     ///
     /// @param ignored first parameter
-    /// @param global_context is a pointer to the global context which 
     /// stores global scope parameters, options, option defintions.
     Subnet6ConfigParser(const std::string&) 
         :SubnetConfigParser("", globalContext()) {
@@ -319,7 +318,7 @@ public:
     /// @param subnets_list pointer to a list of IPv6 subnets
     void build(ConstElementPtr subnets_list) {
         BOOST_FOREACH(ConstElementPtr subnet, subnets_list->listValue()) {
-            ParserPtr parser(new Subnet6ConfigParser("subnet" ));
+            ParserPtr parser(new Subnet6ConfigParser("subnet"));
             parser->build(subnet);
             subnets_.push_back(parser);
         }
@@ -541,7 +540,7 @@ configureDhcp6Server(Dhcpv6Srv&, isc::data::ConstElementPtr config_set) {
     return (answer);
 }
 
-ParserContextPtr globalContext() {
+ParserContextPtr& globalContext() {
     static ParserContextPtr global_context_ptr(new ParserContext(Option::V6));
     return (global_context_ptr);
 }
diff --git a/src/bin/dhcp6/config_parser.h b/src/bin/dhcp6/config_parser.h
index 1d77757..2dce79e 100644
--- a/src/bin/dhcp6/config_parser.h
+++ b/src/bin/dhcp6/config_parser.h
@@ -51,8 +51,8 @@ configureDhcp6Server(Dhcpv6Srv& server, isc::data::ConstElementPtr config_set);
 
 /// @brief Returns the global context
 ///
-/// @returns a const reference to the global context
-ParserContextPtr globalContext();
+/// @returns a reference to the global context
+ParserContextPtr& globalContext();
  
 }; // end of isc::dhcp namespace
 }; // end of isc namespace
diff --git a/src/lib/dhcpsrv/dhcp_parsers.cc b/src/lib/dhcpsrv/dhcp_parsers.cc
index a7e0b1b..63334db 100644
--- a/src/lib/dhcpsrv/dhcp_parsers.cc
+++ b/src/lib/dhcpsrv/dhcp_parsers.cc
@@ -55,17 +55,18 @@ ParserContext::ParserContext(const ParserContext& rhs):
 
 ParserContext& 
 ParserContext::operator=(const ParserContext& rhs) {
-        ParserContext tmp(rhs);
-        boolean_values_ = 
-            BooleanStoragePtr(new BooleanStorage(*(rhs.boolean_values_)));
-        uint32_values_ = 
-            Uint32StoragePtr(new Uint32Storage(*(tmp.uint32_values_)));
-        string_values_ = 
-            StringStoragePtr(new StringStorage(*(tmp.string_values_)));
-        options_ = OptionStoragePtr(new OptionStorage(*(tmp.options_)));
-        option_defs_ = 
-            OptionDefStoragePtr(new OptionDefStorage(*(tmp.option_defs_)));
-        universe_ = rhs.universe_;
+        if (this != &rhs) {
+            boolean_values_ = 
+                BooleanStoragePtr(new BooleanStorage(*(rhs.boolean_values_)));
+            uint32_values_ = 
+                Uint32StoragePtr(new Uint32Storage(*(rhs.uint32_values_)));
+            string_values_ = 
+                StringStoragePtr(new StringStorage(*(rhs.string_values_)));
+            options_ = OptionStoragePtr(new OptionStorage(*(rhs.options_)));
+            option_defs_ = 
+                OptionDefStoragePtr(new OptionDefStorage(*(rhs.option_defs_)));
+            universe_ = rhs.universe_;
+        }
         return (*this);
     }
 
diff --git a/src/lib/dhcpsrv/tests/cfgmgr_unittest.cc b/src/lib/dhcpsrv/tests/cfgmgr_unittest.cc
index adb0a29..dbcb6e3 100644
--- a/src/lib/dhcpsrv/tests/cfgmgr_unittest.cc
+++ b/src/lib/dhcpsrv/tests/cfgmgr_unittest.cc
@@ -163,7 +163,7 @@ public:
         // make sure we start with a clean configuration
         CfgMgr::instance().deleteSubnets4();
         CfgMgr::instance().deleteSubnets6();
-        //CfgMgr::instance().deleteOptionDefs();
+        CfgMgr::instance().deleteOptionDefs();
     }
 
     ~CfgMgrTest() {



More information about the bind10-changes mailing list