From bcd7c48a62a932a15739253b9150e3197bb0f73e Mon Sep 17 00:00:00 2001 From: Razvan Becheriu Date: Thu, 23 Jun 2022 19:15:05 +0300 Subject: [PATCH] [#2266] addressed review comments --- doc/sphinx/arm/hooks-subnet-cmds.rst | 16 ++++++++-------- src/lib/cc/data.cc | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/doc/sphinx/arm/hooks-subnet-cmds.rst b/doc/sphinx/arm/hooks-subnet-cmds.rst index 30bd7f69a8..59975bba77 100644 --- a/doc/sphinx/arm/hooks-subnet-cmds.rst +++ b/doc/sphinx/arm/hooks-subnet-cmds.rst @@ -572,8 +572,8 @@ A successful response may look like this: The ``subnet4-delta-add`` Command ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -This command is used to update by adding or overwriting parts of a single subnet -in the existing server configuration. This operation has no impact on other +This command is used to update a subnet by adding or overwriting its parts in +the existing server configuration. This operation has no impact on other subnets. The subnet identifier is used to identify the subnet to update; it must be specified and must be unique among all subnets. The subnet prefix should not be updated. @@ -649,8 +649,8 @@ level option 4 ("time-servers"). The ``subnet6-delta-add`` Command ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -This command is used to update by adding or overwriting parts of a single subnet -in the existing server configuration. This operation has no impact on other +This command is used to update a subnet by adding or overwriting its parts in +the existing server configuration. This operation has no impact on other subnets. The subnet identifier is used to identify the subnet to update; it must be specified and must be unique among all subnets. The subnet prefix should not be updated. @@ -745,8 +745,8 @@ level option 22 ("sip-server-addr"). The ``subnet4-delta-del`` Command ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -This command is used to update by removing parts of a single subnet in the -existing server configuration. This operation has no impact on other subnets. +This command is used to update a subnet by removing its parts in the existing +server configuration. This operation has no impact on other subnets. The subnet identifier is used to identify the subnet to update; it must be specified and must be unique among all subnets. The subnet prefix should not be updated. @@ -818,8 +818,8 @@ lifetime, removing the subnet level option 3 ("routers"), by removing the pool The ``subnet6-delta-del`` Command ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -This command is used to update by removing parts of a single subnet in the -existing server configuration. This operation has no impact on other subnets. +This command is used to update a subnet by removing its parts in the existing +server configuration. This operation has no impact on other subnets. The subnet identifier is used to identify the subnet to update; it must be specified and must be unique among all subnets. The subnet prefix should not be updated. diff --git a/src/lib/cc/data.cc b/src/lib/cc/data.cc index d87f61e3ab..231b7878f3 100644 --- a/src/lib/cc/data.cc +++ b/src/lib/cc/data.cc @@ -1218,6 +1218,7 @@ mergeDiffDel(ElementPtr& element, ElementPtr& other, if (element->getType() == Element::list) { for (auto const& value : other->listValue()) { + ElementPtr mutable_right = boost::const_pointer_cast(value); for (uint32_t iter = 0; iter < element->listValue().size();) { bool removed = false; // Check if we have any description of the key in the @@ -1225,7 +1226,6 @@ mergeDiffDel(ElementPtr& element, ElementPtr& other, auto f = hierarchy[idx].find(key); if (f != hierarchy[idx].end()) { ElementPtr mutable_left = boost::const_pointer_cast(element->listValue().at(iter)); - ElementPtr mutable_right = boost::const_pointer_cast(value); // Check if the elements refer to the same configuration // entity. if (f->second.match_(mutable_left, mutable_right)) {