osaf/services/saf/amf/amfd/csi.cc | 6 ++++-- osaf/services/saf/amf/amfd/csiattr.cc | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-)
This fixes various CSI related problems reported by Praveen in https://sourceforge.net/p/opensaf/tickets/1642/#5579 Credit: Praveen diff --git a/osaf/services/saf/amf/amfd/csi.cc b/osaf/services/saf/amf/amfd/csi.cc --- a/osaf/services/saf/amf/amfd/csi.cc +++ b/osaf/services/saf/amf/amfd/csi.cc @@ -618,7 +618,7 @@ static SaAisErrorT csi_ccb_completed_mod goto done; } - const std::string required_dn(Amf::to_string(static_cast<SaNameT *>(attr_mod->modAttr.attrValues[0]))); + const std::string required_dn(Amf::to_string(static_cast<SaNameT *>(attr_mod->modAttr.attrValues[0]))); const AVD_CSI *required_csi = csi_db->find(required_dn); // Required CSI must exist in current model @@ -629,7 +629,9 @@ static SaAisErrorT csi_ccb_completed_mod } // Required CSI must be contained in the same SI - if (object_name.find(required_dn) == std::string::npos) { + std::string si_name; + avsv_sanamet_init(required_dn, si_name, "safSi"); + if (object_name.find(si_name) == std::string::npos) { report_ccb_validation_error(opdata, "'%s' is not in the same SI as '%s'", object_name.c_str(), required_dn.c_str()); diff --git a/osaf/services/saf/amf/amfd/csiattr.cc b/osaf/services/saf/amf/amfd/csiattr.cc --- a/osaf/services/saf/amf/amfd/csiattr.cc +++ b/osaf/services/saf/amf/amfd/csiattr.cc @@ -156,12 +156,13 @@ static AVD_CSI_ATTR *csi_name_value_pair **************************************************************************/ static AVD_CSI_ATTR * csi_name_value_pair_find(const AVD_CSI *csi, const std::string& csiattr_name, const char *value) { - AVD_CSI_ATTR *i_attr = csi->list_attributes; + AVD_CSI_ATTR *i_attr = csi->list_attributes; TRACE_ENTER(); while (i_attr != nullptr) { if ((csiattr_name.compare(Amf::to_string(&i_attr->name_value.name)) == 0) && (strncmp((char *)i_attr->name_value.string_ptr, value, strlen(value)) == 0)) { + TRACE_LEAVE(); return i_attr; } i_attr = i_attr->attr_next; @@ -182,6 +183,7 @@ static AVD_CSI_ATTR * is_csiattr_exists( while (i_attr != nullptr) { if (dn.compare(Amf::to_string(&i_attr->name_value.name)) == 0) { + TRACE_LEAVE(); return i_attr; } i_attr = i_attr->attr_next; @@ -534,7 +536,7 @@ static void csiattr_modify_apply(CcbUtil i_attr->attr_next = csiattr; csiattr = i_attr; - osaf_extended_name_alloc(csi_attr_name.c_str(), &csiattr->name_value.value); + osaf_extended_name_alloc(csi_attr_name.c_str(), &csiattr->name_value.name); csiattr->name_value.string_ptr = new char[strlen(value)+1](); memcpy(csiattr->name_value.string_ptr, value, strlen(value)+1 ); } /* for */ ------------------------------------------------------------------------------ _______________________________________________ Opensaf-devel mailing list Opensaf-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/opensaf-devel