Menu

#64 ipmilan.c: avoiding assertion hit in retransmission

version-cvs
open
nobody
5
2014-08-13
2012-11-14
No

I'd like you to review my patch and merge it to the official
source tree.

I wrote the patch based on code reading. I didn't test it at all.

See ipmi_lanplus_send_payload function of lanplus.c.
An assertion is hit when retransmitting datagram with
IPMI_PAYLOAD_TYPE_RMCP_OPEN_REQUEST, IPMI_PAYLOAD_TYPE_RAKP_1, or
IPMI_PAYLOAD_TYPE_RAKP_2 typed payload.

After initial sending those type of datagram, the state of session is
transited with following code:

/* Remember our connection state */
switch (payload->payload_type)
{
case IPMI_PAYLOAD_TYPE_RMCP_OPEN_REQUEST:
session->v2_data.session_state = LANPLUS_STATE_OPEN_SESSION_SENT;
break;
case IPMI_PAYLOAD_TYPE_RAKP_1:
session->v2_data.session_state = LANPLUS_STATE_RAKP_1_SENT;
break;
case IPMI_PAYLOAD_TYPE_RAKP_3:
session->v2_data.session_state = LANPLUS_STATE_RAKP_3_SENT;
break;
}

And when retransmitting following assert statements which checks the
session_state may be hit.

else if (payload->payload_type == IPMI_PAYLOAD_TYPE_RMCP_OPEN_REQUEST)
{
lprintf(LOG_DEBUG, ">> SENDING AN OPEN SESSION REQUEST\n");
assert(session->v2_data.session_state == LANPLUS_STATE_PRESESSION);

else if (payload->payload_type == IPMI_PAYLOAD_TYPE_RAKP_1)
{
lprintf(LOG_DEBUG, ">> SENDING A RAKP 1 MESSAGE\n");
assert(session->v2_data.session_state ==
LANPLUS_STATE_OPEN_SESSION_RECEIEVED);

else if (payload->payload_type == IPMI_PAYLOAD_TYPE_RAKP_3)
{
lprintf(LOG_DEBUG, ">> SENDING A RAKP 3 MESSAGE\n");
assert(session->v2_data.session_state ==
LANPLUS_STATE_RAKP_2_RECEIVED);

The patch is for the code in impitool cvs repository. The intent is
obvious. In a local variable `last_session_state' the state before transition is recorded.
The value stored in `last_session_state' is restored to session->v2_data.session_state
when retransmitting is needed.

Discussion

  • Masatake YAMATO

    Masatake YAMATO - 2012-11-14

    a patch fixing the reported problem

     
  • Zdenek Styblik

    Zdenek Styblik - 2013-06-02
    • assigned_to: zoltar74 --> nobody
     

Log in to post a comment.