Ack. Code review only.

/ Anders Widell

On 12/17/2015 01:54 AM, Minh Hon Chau wrote:
>   osaf/services/saf/clmsv/clms/clms_evt.c |  17 +++++++++--------
>   1 files changed, 9 insertions(+), 8 deletions(-)
>
>
> The coredump happens if the node_up is sent from clm node agent
> not attaching the ip. The error code is set to SA_AIS_ERR_NOT_EXIST,
> but it's incorrectly overwriten to SA_AIS_OK, therefore ip is null
> though being referenced to in later part of proc_node_up_msg.
>
> diff --git a/osaf/services/saf/clmsv/clms/clms_evt.c 
> b/osaf/services/saf/clmsv/clms/clms_evt.c
> --- a/osaf/services/saf/clmsv/clms/clms_evt.c
> +++ b/osaf/services/saf/clmsv/clms/clms_evt.c
> @@ -517,6 +517,7 @@ uint32_t proc_node_up_msg(CLMS_CB * cb,
>       nodeid = evt->info.msg.info.api_info.param.nodeup_info.node_id;
>   
>       node = clms_node_get_by_name(&node_name);
> +     clm_msg.info.api_resp_info.rc = SA_AIS_OK;
>       if (node == NULL) {
>               /* The /etc/opensaf/node_name is an user exposed configuration 
> file.
>                * The node_name file contains the RDN value of the CLM node 
> name.
> @@ -558,14 +559,14 @@ uint32_t proc_node_up_msg(CLMS_CB * cb,
>                               }
>                       }
>               }
> -
> -             if ((cb->node_id != nodeup_info->node_id) && (node->nodeup == 
> SA_TRUE)){
> -                     clm_msg.info.api_resp_info.rc = SA_AIS_ERR_EXIST;
> -                     LOG_ER("Duplicate node join request for CLM node: '%s'. 
> "
> -                                     "Specify a unique node name in" 
> PKGSYSCONFDIR "/node_name",
> -                                     nodeup_info->node_name.value);
> -             } else
> -                     clm_msg.info.api_resp_info.rc = SA_AIS_OK;
> +             if (clm_msg.info.api_resp_info.rc == SA_AIS_OK) {
> +                     if ((cb->node_id != nodeup_info->node_id) && 
> (node->nodeup == SA_TRUE)){
> +                             clm_msg.info.api_resp_info.rc = 
> SA_AIS_ERR_EXIST;
> +                             LOG_ER("Duplicate node join request for CLM 
> node: '%s'. "
> +                                             "Specify a unique node name in" 
> PKGSYSCONFDIR "/node_name",
> +                                             nodeup_info->node_name.value);
> +                     }
> +             }
>   
>       } /* Node exists in DB */
>   


------------------------------------------------------------------------------
_______________________________________________
Opensaf-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensaf-devel

Reply via email to