← Back to team overview

rohc team mailing list archive

rohc-lib 1.7.0 - problem with new return values (rohc_status_t) and lost tcp packets

 

Hi,

I have discovered a problem with the new positive values for rohc_status_t.
In the d_tcp_decode function(in d_tcp.c) the following code operates
incorrectly due to the positive return value if there is an error.

if(ret >= 0)
{
uncomp_packet->len += ret;
ret = ROHC_STATUS_OK;
}
rohc_decomp_debug(context, "return %d", ret);

The new return values defined in rohc_status_t are all positive so the code
above assumes that the length of the decompression was returned. I assume
changing the values to negative in the definition of rohc_status_t will fix
this? or are the situations were the type of the return value is unsigned?

I found this problem when implementing a fix to an assertion error in the
decompressor when tcp compressed packets are lost. My quick fix to this is
to return an error when the MSN increments more than 1, which is in the
code below (from d_tcp.c).

// Check the MSN received with MSN required
if( ( (tcp_context->msn + 1) & 0x000F ) != msn)
{
rohc_decomp_debug(context, "last_msn = 0x%04x, waiting for msn = 0x%x, "
                  "received 0x%x!", tcp_context->msn,
                  (tcp_context->msn + 1) & 0x000F, msn);
// To be completed !!!
// Store and rework packets
   //Fixes missing packet assert problems.
   rohc_decomp_debug(context, "Error packet missing - assuming context
damaged\n");
   goto error;

}

>From the comments in the code it appears that the implementation of a
recovery mechanism is planned when packets are lost. Is an implementation
being worked on?

Regards,

Sean

Follow ups