Browse Source

[3589] CfgOptionDef::copy overrides old configuration.

Marcin Siodelski 10 years ago
parent
commit
bcd7471987
2 changed files with 2 additions and 5 deletions
  1. 2 0
      src/lib/dhcpsrv/cfg_option_def.cc
  2. 0 5
      src/lib/dhcpsrv/cfg_option_def.h

+ 2 - 0
src/lib/dhcpsrv/cfg_option_def.cc

@@ -22,6 +22,8 @@ namespace dhcp {
 
 void
 CfgOptionDef::copyTo(CfgOptionDef& new_config) const {
+    // Remove any existing option definitions from the destination.
+    new_config.option_definitions_.clearItems();
     const std::list<std::string>& names =
         option_definitions_.getOptionSpaceNames();
     for (std::list<std::string>::const_iterator name = names.begin();

+ 0 - 5
src/lib/dhcpsrv/cfg_option_def.h

@@ -43,11 +43,6 @@ public:
     /// to an object passed as parameter. There are no shared objects or
     /// pointers between the original object and a copy.
     ///
-    /// @warning This function doesn't perform a cleanup of the @c new_config
-    /// before copying the new configuration into it. It is caller's
-    /// responsibility to make sure that this object doesn't contain any
-    /// garbage data.
-    ///
     /// @param [out] new_config An object to which the configuration will be
     /// copied.
     void copyTo(CfgOptionDef& new_config) const;