[devel] [PATCH 1 of 1] amfnd: ignore cleanup succ event during shutdown [#1915]
osaf/services/saf/amf/amfnd/clc.cc | 22 ++ 1 files changed, 22 insertions(+), 0 deletions(-) When opensafd is shutting down, the cleanup succ event of component should be ignored because, there is no further event need to occur for another comp ot su. diff --git a/osaf/services/saf/amf/amfnd/clc.cc b/osaf/services/saf/amf/amfnd/clc.cc --- a/osaf/services/saf/amf/amfnd/clc.cc +++ b/osaf/services/saf/amf/amfnd/clc.cc @@ -809,6 +809,28 @@ uint32_t avnd_comp_clc_fsm_run(AVND_CB * } } + if ((cb->term_state == AVND_TERM_STATE_OPENSAF_SHUTDOWN_STARTED) && + m_AVND_SU_IS_PREINSTANTIABLE(comp->su) && + (!m_AVND_COMP_TYPE_IS_PREINSTANTIABLE(comp)) && + (comp->pres == SA_AMF_PRESENCE_TERMINATING)) { + TRACE("Term state is SHUTDOWN STARTED, event '%s'", pres_state_evt[ev]); + switch (ev) { + case AVND_COMP_CLC_PRES_FSM_EV_CLEANUP_SUCC: + avnd_comp_pres_state_set(cb, comp, SA_AMF_PRESENCE_UNINSTANTIATED); + if (all_comps_terminated()) { + LOG_NO("Terminated all AMF components"); + LOG_NO("Shutdown completed, exiting"); + exit(0); + } else { + TRACE("Do nothing"); + goto done; + } + default: + LOG_ER("Ignoring event '%s' for '%s' during node shutdown", + pres_state_evt[ev], comp->name.value); + goto done; + } + } /* get the prv presence state */ prv_st = comp->pres; -- What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic patterns at an interface-level. Reveals which users, apps, and protocols are consuming the most bandwidth. Provides multi-vendor support for NetFlow, J-Flow, sFlow and other flows. Make informed decisions using capacity planning reports.http://sdm.link/zohodev2dev ___ Opensaf-devel mailing list Opensaf-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/opensaf-devel
[devel] [PATCH 0 of 1] Review Request for amfnd: ignore cleanup succ event during shutdown [#1915]
Summary: amfnd: ignore cleanup succ event during shutdown [#1915] Review request for Trac Ticket(s): #1915 Peer Reviewer(s): Amf Dev Pull request to: <> Affected branch(es): All Development branch: 5.0.x Impacted area Impact y/n Docsn Build systemn RPM/packaging n Configuration files n Startup scripts n SAF servicesy OpenSAF servicesn Core libraries n Samples n Tests n Other n Comments (indicate scope for each "y" above): - <> changeset 9a9c032a153338f159389b57e120b2ae8e06e75a Author: Nagendra Kumar Date: Fri, 15 Jul 2016 11:31:18 +0530 amfnd: ignore cleanup succ event during shutdown [#1915] When opensafd is shutting down, the cleanup succ event of component should be ignored because, there is no further event need to occur for another comp ot su. Complete diffstat: -- osaf/services/saf/amf/amfnd/clc.cc | 22 ++ 1 files changed, 22 insertions(+), 0 deletions(-) Testing Commands: - Please check the ticket. Testing, Expected Results: -- Amfnd shouldn't generate core dump. Conditions of Submission: - Ack Arch Built StartedLinux distro --- mipsn n mips64 n n x86 n n x86_64 y y powerpc n n powerpc64 n n Reviewer Checklist: --- [Submitters: make sure that your review doesn't trigger any checkmarks!] Your checkin has not passed review because (see checked entries): ___ Your RR template is generally incomplete; it has too many blank entries that need proper data filled in. ___ You have failed to nominate the proper persons for review and push. ___ Your patches do not have proper short+long header ___ You have grammar/spelling in your header that is unacceptable. ___ You have exceeded a sensible line length in your headers/comments/text. ___ You have failed to put in a proper Trac Ticket # into your commits. ___ You have incorrectly put/left internal data in your comments/files (i.e. internal bug tracking tool IDs, product names etc) ___ You have not given any evidence of testing beyond basic build tests. Demonstrate some level of runtime or other sanity testing. ___ You have ^M present in some of your files. These have to be removed. ___ You have needlessly changed whitespace or added whitespace crimes like trailing spaces, or spaces before tabs. ___ You have mixed real technical changes with whitespace and other cosmetic code cleanup changes. These have to be separate commits. ___ You need to refactor your submission into logical chunks; there is too much content into a single commit. ___ You have extraneous garbage in your review (merge commits etc) ___ You have giant attachments which should never have been sent; Instead you should place your content in a public tree to be pulled. ___ You have too many commits attached to an e-mail; resend as threaded commits, or place in a public tree for a pull. ___ You have resent this content multiple times without a clear indication of what has changed between each re-send. ___ You have failed to adequately and individually address all of the comments and change requests that were proposed in the initial review. ___ You have a misconfigured ~/.hgrc file (i.e. username, email etc) ___ Your computer have a badly configured date and time; confusing the the threaded patch review. ___ Your changes affect IPC mechanism, and you don't present any results for in-service upgradability test. ___ Your changes affect user manual and documentation, your patch series do not contain the patch that updates the Doxygen manual. -- What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic patterns at an interface-level. Reveals which users, apps, and protocols are consuming the most bandwidth. Provides multi-vendor support for NetFlow, J-Flow, sFlow and other flows. Make informed decisions using capacity planning reports.http://sdm.link/zohodev2dev ___ Opensaf-devel mailing list Opensaf-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/opensaf-devel
[devel] [PATCH 0 of 1] Review Request for clm: fix return error codes in IMM callbacks [#1917]
Summary: clm: fix return error codes in IMM callbacks [#1917] Review request for Trac Ticket(s): 1917 Peer Reviewer(s): Mathi Pull request to: Zoran Affected branch(es): opensaf-4.7.x, opensaf-5.0.x, default(5.1) Development branch: <> Impacted area Impact y/n Docsn Build systemn RPM/packaging n Configuration files n Startup scripts n SAF servicesy OpenSAF servicesn Core libraries n Samples n Tests n Other n Comments (indicate scope for each "y" above): - changeset 2d9a4cf1beefaedfc2b6ff16cf6c76f4838298b5 Author: Zoran Milinkovic Date: Fri, 15 Jul 2016 12:37:48 +0200 clm: fix return error codes in IMM callbacks [#1917] Wrong used error codes SA_AIS_ERR_NOT_SUPPORTED and SA_AIS_ERR_INAVLID_PARAM are replaced with SA_AIS_ERR_BAD_OPERATION. Complete diffstat: -- osaf/services/saf/clmsv/clms/clms_imm.c | 12 ++-- 1 files changed, 6 insertions(+), 6 deletions(-) Testing Commands: - <> Testing, Expected Results: -- <> Conditions of Submission: - Ack from Mathi Arch Built StartedLinux distro --- mipsn n mips64 n n x86 n n x86_64 n n powerpc n n powerpc64 n n Reviewer Checklist: --- [Submitters: make sure that your review doesn't trigger any checkmarks!] Your checkin has not passed review because (see checked entries): ___ Your RR template is generally incomplete; it has too many blank entries that need proper data filled in. ___ You have failed to nominate the proper persons for review and push. ___ Your patches do not have proper short+long header ___ You have grammar/spelling in your header that is unacceptable. ___ You have exceeded a sensible line length in your headers/comments/text. ___ You have failed to put in a proper Trac Ticket # into your commits. ___ You have incorrectly put/left internal data in your comments/files (i.e. internal bug tracking tool IDs, product names etc) ___ You have not given any evidence of testing beyond basic build tests. Demonstrate some level of runtime or other sanity testing. ___ You have ^M present in some of your files. These have to be removed. ___ You have needlessly changed whitespace or added whitespace crimes like trailing spaces, or spaces before tabs. ___ You have mixed real technical changes with whitespace and other cosmetic code cleanup changes. These have to be separate commits. ___ You need to refactor your submission into logical chunks; there is too much content into a single commit. ___ You have extraneous garbage in your review (merge commits etc) ___ You have giant attachments which should never have been sent; Instead you should place your content in a public tree to be pulled. ___ You have too many commits attached to an e-mail; resend as threaded commits, or place in a public tree for a pull. ___ You have resent this content multiple times without a clear indication of what has changed between each re-send. ___ You have failed to adequately and individually address all of the comments and change requests that were proposed in the initial review. ___ You have a misconfigured ~/.hgrc file (i.e. username, email etc) ___ Your computer have a badly configured date and time; confusing the the threaded patch review. ___ Your changes affect IPC mechanism, and you don't present any results for in-service upgradability test. ___ Your changes affect user manual and documentation, your patch series do not contain the patch that updates the Doxygen manual. -- What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic patterns at an interface-level. Reveals which users, apps, and protocols are consuming the most bandwidth. Provides multi-vendor support for NetFlow, J-Flow, sFlow and other flows. Make informed decisions using capacity planning reports.http://sdm.link/zohodev2dev ___ Opensaf-devel mailing list Opensaf-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/opensaf-devel
[devel] [PATCH 1 of 1] clm: fix return error codes in IMM callbacks [#1917]
osaf/services/saf/clmsv/clms/clms_imm.c | 12 ++-- 1 files changed, 6 insertions(+), 6 deletions(-) Wrong used error codes SA_AIS_ERR_NOT_SUPPORTED and SA_AIS_ERR_INAVLID_PARAM are replaced with SA_AIS_ERR_BAD_OPERATION. diff --git a/osaf/services/saf/clmsv/clms/clms_imm.c b/osaf/services/saf/clmsv/clms/clms_imm.c --- a/osaf/services/saf/clmsv/clms/clms_imm.c +++ b/osaf/services/saf/clmsv/clms/clms_imm.c @@ -1401,7 +1401,7 @@ static SaAisErrorT clms_imm_ccb_obj_crea /* Find the RDN attribute and store the object DN */ while ((attrValue = attr[i++]) != NULL) { if (!strncmp(attrValue->attrName, "safCluster", 10)) { - rc = SA_AIS_ERR_NOT_SUPPORTED; + rc = SA_AIS_ERR_BAD_OPERATION; goto done; } else if (!strncmp(attrValue->attrName, "safNode", 7)) { if (attrValue->attrValueType == SA_IMM_ATTR_SASTRINGT) { @@ -1423,7 +1423,7 @@ static SaAisErrorT clms_imm_ccb_obj_crea if ((rt = clms_node_dn_chk(&operation->objectName)) != NCSCC_RC_SUCCESS) { TRACE("Node DN name is incorrect"); - rc = SA_AIS_ERR_INVALID_PARAM; + rc = SA_AIS_ERR_BAD_OPERATION; } done: @@ -1452,7 +1452,7 @@ static SaAisErrorT clms_imm_ccb_obj_dele if (!strncmp((const char *)objectName->value, "safCluster=", 11)) { LOG_ER("Deletion of the present single cluster Object not supported"); - rc = SA_AIS_ERR_NOT_SUPPORTED; + rc = SA_AIS_ERR_BAD_OPERATION; } TRACE_LEAVE(); @@ -1547,11 +1547,11 @@ SaAisErrorT clms_node_ccb_comp_modify(Cc } } else if (!strcmp(attribute->attrName, "saClmNodeAddressFamily")) { LOG_NO("Modification of saClmNodeAddressFamily of object %s not allowed",opdata->objectName.value); - rc = SA_AIS_ERR_NOT_SUPPORTED; + rc = SA_AIS_ERR_BAD_OPERATION; goto done; } else if (!strcmp(attribute->attrName, "saClmNodeAddress")) { LOG_NO("Modification of saClmNodeAddress of object %s not allowed",opdata->objectName.value); - rc = SA_AIS_ERR_NOT_SUPPORTED; + rc = SA_AIS_ERR_BAD_OPERATION; goto done; } else if (!strcmp(attribute->attrName, "saClmNodeLockCallbackTimeout")) { SaTimeT Timeout = *((SaTimeT *)value); @@ -1567,7 +1567,7 @@ SaAisErrorT clms_node_ccb_comp_modify(Cc goto done; } else { LOG_NO("saClmNodeEE attribute change of object %s is not supported",opdata->objectName.value); - rc = SA_AIS_ERR_NOT_SUPPORTED; + rc = SA_AIS_ERR_BAD_OPERATION; goto done; } } else { -- What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic patterns at an interface-level. Reveals which users, apps, and protocols are consuming the most bandwidth. Provides multi-vendor support for NetFlow, J-Flow, sFlow and other flows. Make informed decisions using capacity planning reports.http://sdm.link/zohodev2dev ___ Opensaf-devel mailing list Opensaf-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/opensaf-devel
[devel] [PATCH 1 of 1] clm: add support for long RDN for clm service [#1906]
osaf/services/saf/clmsv/clms/clms_imm.c | 73 +++ osaf/services/saf/clmsv/clms/clms_main.c | 5 ++ osaf/services/saf/clmsv/clms/clms_util.c | 7 +++ 3 files changed, 75 insertions(+), 10 deletions(-) Add support for long RDN to support RDN values longer than 64 bytes diff --git a/osaf/services/saf/clmsv/clms/clms_imm.c b/osaf/services/saf/clmsv/clms/clms_imm.c --- a/osaf/services/saf/clmsv/clms/clms_imm.c +++ b/osaf/services/saf/clmsv/clms/clms_imm.c @@ -18,6 +18,7 @@ #include #include "clms.h" +#include "osaf_extended_name.h" extern struct ImmutilWrapperProfile immutilWrapperProfile; @@ -222,9 +223,17 @@ CLMS_CLUSTER_NODE *clms_node_new(SaNameT } else if (!strcmp(attr->attrName, "saClmNodeEE")) { SaNameT *name = (SaNameT *)value; - TRACE("saClmNodeEE attribute name's length %d", name->length); - - if (name->length != 0) { + size_t nameLen = osaf_extended_name_length(name); + + TRACE("saClmNodeEE attribute name's length %lu", nameLen); + + if (nameLen != 0) { + if (nameLen >= SA_MAX_NAME_LENGTH) { + LOG_ER("saClmNodeEE attribute name length is longer than 255"); + free(node); + node = NULL; + goto done; + } if (strncmp((const char *)name->value,"safEE=",6)){ LOG_ER("Please provide the saf compliant ee name"); free(node); @@ -1383,8 +1392,19 @@ static SaAisErrorT clms_imm_ccb_obj_crea uint32_t rt; CcbUtilCcbData_t *ccb_util_ccb_data; CcbUtilOperationData_t *operation = NULL; - - TRACE_ENTER2("CCB ID %llu, class %s, parent %s", ccbId, className, parentName->value); + size_t parentNameLen = 0; + + TRACE_ENTER2("CCB ID %llu, class %s, parent %s", ccbId, className, + parentName ? osaf_extended_name_borrow(parentName) : "(null)"); + + if(parentName) { + parentNameLen = osaf_extended_name_length(parentName); + if(parentNameLen >= SA_MAX_NAME_LENGTH) { + LOG_ER("Parent name is longer than 255"); + rc = SA_AIS_ERR_BAD_OPERATION; + goto done; + } + } if ((ccb_util_ccb_data = ccbutil_getCcbData(ccbId)) != NULL) { int i = 0; @@ -1406,17 +1426,30 @@ static SaAisErrorT clms_imm_ccb_obj_crea } else if (!strncmp(attrValue->attrName, "safNode", 7)) { if (attrValue->attrValueType == SA_IMM_ATTR_SASTRINGT) { SaStringT rdnVal = *((SaStringT *)attrValue->attrValues[0]); - if ((parentName != NULL) && (parentName->length > 0)) { + if ((parentName != NULL) && (parentNameLen > 0) + && (strlen(rdnVal) + parentNameLen + 1) < SA_MAX_NAME_LENGTH) { operation->objectName.length = - (SaUint16T)sprintf((char *)operation->objectName.value, "%s,%s", - rdnVal, parentName->value); + (SaUint16T)sprintf((char *)operation->objectName.value, "%s,%s", + rdnVal, parentName->value); } else { + if(!parentName || parentNameLen == 0) { + LOG_ER("Node DN name is incorrect. Parent is NULL or empty"); + } else { + LOG_ER("Node DN name is incorrect. DN is longer than 255"); + } rc = SA_AIS_ERR_BAD_OPERATION; + goto done; } } TRACE("Operation's object Name %s", operation->objectName.value); - + } else if (!strncmp(attrValue->attrName, "saClmNodeEE", 11) && attrValue->attrValuesNumber == 1) { + SaNameT *name = (SaNameT *)attrValue->attrValues[0]; + if(osaf_extended_name_length(name) >= SA_MAX_NAME_LENGTH) { +
[devel] [PATCH 0 of 1] Review Request for clm: add support for long RDN [#1906]
Summary: clm: add support for long RDN [#1906] Review request for Trac Ticket(s): 1906 Peer Reviewer(s): Mathi Pull request to: Zoran Affected branch(es): default(5.1) Development branch: default(5.1) Impacted area Impact y/n Docsn Build systemn RPM/packaging n Configuration files n Startup scripts n SAF servicesy OpenSAF servicesn Core libraries n Samples n Tests n Other n Comments (indicate scope for each "y" above): - changeset 7ebdd0d9fdca85fc6eb6604aed3c76f2db6a7fc2 Author: Zoran Milinkovic Date: Fri, 15 Jul 2016 23:51:02 +0200 clm: add support for long RDN for clm service [#1906] Add support for long RDN to support RDN values longer than 64 bytes Complete diffstat: -- osaf/services/saf/clmsv/clms/clms_imm.c | 73 +++-- osaf/services/saf/clmsv/clms/clms_main.c | 5 + osaf/services/saf/clmsv/clms/clms_util.c | 7 +++ 3 files changed, 75 insertions(+), 10 deletions(-) Testing Commands: - <> Testing, Expected Results: -- Test that CLM support RDNs longer than 64 bytes Conditions of Submission: - Ack from Mathi Arch Built StartedLinux distro --- mipsn n mips64 n n x86 n n x86_64 n n powerpc n n powerpc64 n n Reviewer Checklist: --- [Submitters: make sure that your review doesn't trigger any checkmarks!] Your checkin has not passed review because (see checked entries): ___ Your RR template is generally incomplete; it has too many blank entries that need proper data filled in. ___ You have failed to nominate the proper persons for review and push. ___ Your patches do not have proper short+long header ___ You have grammar/spelling in your header that is unacceptable. ___ You have exceeded a sensible line length in your headers/comments/text. ___ You have failed to put in a proper Trac Ticket # into your commits. ___ You have incorrectly put/left internal data in your comments/files (i.e. internal bug tracking tool IDs, product names etc) ___ You have not given any evidence of testing beyond basic build tests. Demonstrate some level of runtime or other sanity testing. ___ You have ^M present in some of your files. These have to be removed. ___ You have needlessly changed whitespace or added whitespace crimes like trailing spaces, or spaces before tabs. ___ You have mixed real technical changes with whitespace and other cosmetic code cleanup changes. These have to be separate commits. ___ You need to refactor your submission into logical chunks; there is too much content into a single commit. ___ You have extraneous garbage in your review (merge commits etc) ___ You have giant attachments which should never have been sent; Instead you should place your content in a public tree to be pulled. ___ You have too many commits attached to an e-mail; resend as threaded commits, or place in a public tree for a pull. ___ You have resent this content multiple times without a clear indication of what has changed between each re-send. ___ You have failed to adequately and individually address all of the comments and change requests that were proposed in the initial review. ___ You have a misconfigured ~/.hgrc file (i.e. username, email etc) ___ Your computer have a badly configured date and time; confusing the the threaded patch review. ___ Your changes affect IPC mechanism, and you don't present any results for in-service upgradability test. ___ Your changes affect user manual and documentation, your patch series do not contain the patch that updates the Doxygen manual. -- What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic patterns at an interface-level. Reveals which users, apps, and protocols are consuming the most bandwidth. Provides multi-vendor support for NetFlow, J-Flow, sFlow and other flows. Make informed decisions using capacity planning reports.http://sdm.link/zohodev2dev ___ Opensaf-devel mailing list Opensaf-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/opensaf-devel
[devel] [PATCH 1 of 2] clm: add support for long RDN for clm library [#1906]
osaf/libs/agents/saf/clma/clma_api.c | 85 - osaf/libs/agents/saf/clma/clma_util.c | 14 + osaf/libs/common/clmsv/clmsv_enc_dec.c | 32 3 files changed, 96 insertions(+), 35 deletions(-) Add support for long RDN to support RDN values longer than 64 bytes diff --git a/osaf/libs/agents/saf/clma/clma_api.c b/osaf/libs/agents/saf/clma/clma_api.c --- a/osaf/libs/agents/saf/clma/clma_api.c +++ b/osaf/libs/agents/saf/clma/clma_api.c @@ -31,6 +31,7 @@ #include "clma.h" #include "ncs_main_papi.h" +#include "osaf_extended_name.h" #define CLMS_WAIT_TIME 1000 #define CLM_API_MIN_TIMEOUT 10 /* ten milli seconds */ @@ -84,10 +85,7 @@ void clma_fill_node_from_node4(SaClmClus clusterNode->nodeAddress.length = clusterNode_4.nodeAddress.length; (void)memcpy(clusterNode->nodeAddress.value, clusterNode_4.nodeAddress.value, clusterNode->nodeAddress.length); clusterNode->nodeName.length = clusterNode_4.nodeName.length; - (void)memcpy(clusterNode->nodeName.value, clusterNode_4.nodeName.value, clusterNode->nodeName.length); - clusterNode->nodeName.value[clusterNode->nodeName.length < - SA_MAX_NAME_LENGTH ? clusterNode->nodeName.length : - SA_MAX_NAME_LENGTH - 1] = '\0'; + osaf_extended_name_alloc(osaf_extended_name_borrow(&clusterNode_4.nodeName), &clusterNode->nodeName); clusterNode->member = clusterNode_4.member; clusterNode->bootTimestamp = clusterNode_4.bootTimestamp; clusterNode->initialViewNumber = clusterNode_4.initialViewNumber; @@ -119,8 +117,17 @@ static SaAisErrorT clma_validate_flags_b /* validate the notify buffer */ if ((flags & SA_TRACK_CURRENT) && buf && buf->notification) { + uint32_t i; + if (!buf->numberOfItems) return SA_AIS_ERR_INVALID_PARAM; + + // Check that nodeName is not longer than 255 + for(i=0; inumberOfItems; i++) { + if(osaf_extended_name_length(&buf->notification[i].clusterNode.nodeName) >= SA_MAX_NAME_LENGTH) { + return SA_AIS_ERR_INVALID_PARAM; + } + } } /* Validate if flag is TRACK_CURRENT and no callback and no buffer provided */ @@ -160,10 +167,24 @@ static SaAisErrorT clma_validate_flags_b /* validate the notify buffer */ if ((flags & SA_TRACK_CURRENT) && buf && buf->notification) { + uint32_t i; + if (!buf->numberOfItems) { TRACE_LEAVE(); return SA_AIS_ERR_INVALID_PARAM; } + + // Check that nodeName and EE are not longer than 255 + for(i=0; inumberOfItems; i++) { + if(osaf_extended_name_length(&buf->notification[i].clusterNode.nodeName) >= SA_MAX_NAME_LENGTH) { + TRACE_LEAVE(); + return SA_AIS_ERR_INVALID_PARAM; + } + if(osaf_extended_name_length(&buf->notification[i].clusterNode.executionEnvironment) >= SA_MAX_NAME_LENGTH) { + TRACE_LEAVE(); + return SA_AIS_ERR_INVALID_PARAM; + } + } } /* Validate if flag is TRACK_CURRENT and no callback and no buffer provided */ @@ -228,16 +249,18 @@ static SaAisErrorT clma_fill_cluster_ntf return SA_AIS_ERR_NO_MEMORY; if (buf_4->notification != NULL && - (buf_4->numberOfItems >= msg_rsp->info.api_resp_info.param.track.notify_info->numberOfItems)) { + (buf_4->numberOfItems >= msg_rsp->info.api_resp_info.param.track.notify_info->numberOfItems)) { /* Overwrite the numberOfItems and copy it to buffer */ buf_4->numberOfItems = msg_rsp->info.api_resp_info.param.track.notify_info->numberOfItems; buf_4->viewNumber = msg_rsp->info.api_resp_info.param.track.notify_info->viewNumber; memset(buf_4->notification, 0, sizeof(SaClmClusterNotificationT_4) * buf_4->numberOfItems); memcpy(buf_4->notification, msg_rsp->info.api_resp_info.param.track.notify_info->notification, - sizeof(SaClmClusterNotificationT_4) * buf_4->numberOfItems); -} else if(buf_4->notification != NULL && - (buf_4->numberOfItems < msg_rsp->info.api_resp_info.param.track.notify_info->numberOfItems)) { + sizeof(SaClmClusterNotificationT_4) * buf_4->numberOfItems); + + /* TODO: Code for copying long DNs for nodeName and EE when full long DN support is implemented. */ + } else if(buf_4->notification != NULL && + (buf_4->numberOfItems < msg_rsp->info.api_resp_info.param.track.notify_info->numb
[devel] [PATCH 2 of 2] clm: add support for long RDN for clm service [#1906]
osaf/services/saf/clmsv/clms/clms_imm.c | 73 +++ osaf/services/saf/clmsv/clms/clms_main.c | 5 ++ osaf/services/saf/clmsv/clms/clms_util.c | 7 +++ 3 files changed, 75 insertions(+), 10 deletions(-) Add support for long RDN to support RDN values longer than 64 bytes diff --git a/osaf/services/saf/clmsv/clms/clms_imm.c b/osaf/services/saf/clmsv/clms/clms_imm.c --- a/osaf/services/saf/clmsv/clms/clms_imm.c +++ b/osaf/services/saf/clmsv/clms/clms_imm.c @@ -18,6 +18,7 @@ #include #include "clms.h" +#include "osaf_extended_name.h" extern struct ImmutilWrapperProfile immutilWrapperProfile; @@ -222,9 +223,17 @@ CLMS_CLUSTER_NODE *clms_node_new(SaNameT } else if (!strcmp(attr->attrName, "saClmNodeEE")) { SaNameT *name = (SaNameT *)value; - TRACE("saClmNodeEE attribute name's length %d", name->length); - - if (name->length != 0) { + size_t nameLen = osaf_extended_name_length(name); + + TRACE("saClmNodeEE attribute name's length %lu", nameLen); + + if (nameLen != 0) { + if (nameLen >= SA_MAX_NAME_LENGTH) { + LOG_ER("saClmNodeEE attribute name length is longer than 255"); + free(node); + node = NULL; + goto done; + } if (strncmp((const char *)name->value,"safEE=",6)){ LOG_ER("Please provide the saf compliant ee name"); free(node); @@ -1383,8 +1392,19 @@ static SaAisErrorT clms_imm_ccb_obj_crea uint32_t rt; CcbUtilCcbData_t *ccb_util_ccb_data; CcbUtilOperationData_t *operation = NULL; - - TRACE_ENTER2("CCB ID %llu, class %s, parent %s", ccbId, className, parentName->value); + size_t parentNameLen = 0; + + TRACE_ENTER2("CCB ID %llu, class %s, parent %s", ccbId, className, + parentName ? osaf_extended_name_borrow(parentName) : "(null)"); + + if(parentName) { + parentNameLen = osaf_extended_name_length(parentName); + if(parentNameLen >= SA_MAX_NAME_LENGTH) { + LOG_ER("Parent name is longer than 255"); + rc = SA_AIS_ERR_BAD_OPERATION; + goto done; + } + } if ((ccb_util_ccb_data = ccbutil_getCcbData(ccbId)) != NULL) { int i = 0; @@ -1406,17 +1426,30 @@ static SaAisErrorT clms_imm_ccb_obj_crea } else if (!strncmp(attrValue->attrName, "safNode", 7)) { if (attrValue->attrValueType == SA_IMM_ATTR_SASTRINGT) { SaStringT rdnVal = *((SaStringT *)attrValue->attrValues[0]); - if ((parentName != NULL) && (parentName->length > 0)) { + if ((parentName != NULL) && (parentNameLen > 0) + && (strlen(rdnVal) + parentNameLen + 1) < SA_MAX_NAME_LENGTH) { operation->objectName.length = - (SaUint16T)sprintf((char *)operation->objectName.value, "%s,%s", - rdnVal, parentName->value); + (SaUint16T)sprintf((char *)operation->objectName.value, "%s,%s", + rdnVal, parentName->value); } else { + if(!parentName || parentNameLen == 0) { + LOG_ER("Node DN name is incorrect. Parent is NULL or empty"); + } else { + LOG_ER("Node DN name is incorrect. DN is longer than 255"); + } rc = SA_AIS_ERR_BAD_OPERATION; + goto done; } } TRACE("Operation's object Name %s", operation->objectName.value); - + } else if (!strncmp(attrValue->attrName, "saClmNodeEE", 11) && attrValue->attrValuesNumber == 1) { + SaNameT *name = (SaNameT *)attrValue->attrValues[0]; + if(osaf_extended_name_length(name) >= SA_MAX_NAME_LENGTH) { +
[devel] [PATCH 0 of 2] Review Request for clm: add support for long RDN [#1906]
Summary: clm: add support for long RDN [#1906] Review request for Trac Ticket(s): 1906 Peer Reviewer(s): Mathi Pull request to: Zoran Affected branch(es): default(5.1) Development branch: default(5.1) Impacted area Impact y/n Docsn Build systemn RPM/packaging n Configuration files n Startup scripts n SAF servicesy OpenSAF servicesn Core libraries n Samples n Tests n Other n Comments (indicate scope for each "y" above): - changeset 95f06964c2a6117d839fd33e1b334cd01ee803a9 Author: Zoran Milinkovic Date: Fri, 15 Jul 2016 23:50:34 +0200 clm: add support for long RDN for clm library [#1906] Add support for long RDN to support RDN values longer than 64 bytes changeset 7ebdd0d9fdca85fc6eb6604aed3c76f2db6a7fc2 Author: Zoran Milinkovic Date: Fri, 15 Jul 2016 23:51:02 +0200 clm: add support for long RDN for clm service [#1906] Add support for long RDN to support RDN values longer than 64 bytes Complete diffstat: -- osaf/libs/agents/saf/clma/clma_api.c | 85 ++--- osaf/libs/agents/saf/clma/clma_util.c| 14 ++ osaf/libs/common/clmsv/clmsv_enc_dec.c | 32 osaf/services/saf/clmsv/clms/clms_imm.c | 73 +++-- osaf/services/saf/clmsv/clms/clms_main.c | 5 + osaf/services/saf/clmsv/clms/clms_util.c | 7 +++ 6 files changed, 171 insertions(+), 45 deletions(-) Testing Commands: - <> Testing, Expected Results: -- Test that long RDN is supported in CLM Conditions of Submission: - Ack from Mathi Arch Built StartedLinux distro --- mipsn n mips64 n n x86 n n x86_64 n n powerpc n n powerpc64 n n Reviewer Checklist: --- [Submitters: make sure that your review doesn't trigger any checkmarks!] Your checkin has not passed review because (see checked entries): ___ Your RR template is generally incomplete; it has too many blank entries that need proper data filled in. ___ You have failed to nominate the proper persons for review and push. ___ Your patches do not have proper short+long header ___ You have grammar/spelling in your header that is unacceptable. ___ You have exceeded a sensible line length in your headers/comments/text. ___ You have failed to put in a proper Trac Ticket # into your commits. ___ You have incorrectly put/left internal data in your comments/files (i.e. internal bug tracking tool IDs, product names etc) ___ You have not given any evidence of testing beyond basic build tests. Demonstrate some level of runtime or other sanity testing. ___ You have ^M present in some of your files. These have to be removed. ___ You have needlessly changed whitespace or added whitespace crimes like trailing spaces, or spaces before tabs. ___ You have mixed real technical changes with whitespace and other cosmetic code cleanup changes. These have to be separate commits. ___ You need to refactor your submission into logical chunks; there is too much content into a single commit. ___ You have extraneous garbage in your review (merge commits etc) ___ You have giant attachments which should never have been sent; Instead you should place your content in a public tree to be pulled. ___ You have too many commits attached to an e-mail; resend as threaded commits, or place in a public tree for a pull. ___ You have resent this content multiple times without a clear indication of what has changed between each re-send. ___ You have failed to adequately and individually address all of the comments and change requests that were proposed in the initial review. ___ You have a misconfigured ~/.hgrc file (i.e. username, email etc) ___ Your computer have a badly configured date and time; confusing the the threaded patch review. ___ Your changes affect IPC mechanism, and you don't present any results for in-service upgradability test. ___ Your changes affect user manual and documentation, your patch series do not contain the patch that updates the Doxygen manual. -- What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic patterns at an interface-level. Reveals which users, apps, and protocols are consuming the most bandwidth. Provides multi-vendor support for NetFlow, J-Flow, sFlow and other flows. Make informed deci