This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

NDK 2.00 TCP SACK error

Hello,

I recogniced a problem according the SACK handling with NDK 2.00 using DSP/BIOS5, CCSv5 and a DM648.

The stack could completely stuck if the Options informaion is not valid.

tcpin.c Line  308 Function TcpInput// Process Options - RFC 2018 SACK
    if (OptLen > 0) {
        int    i;
        INT8   olen;
        uint   mss;

        for (i = 0; i < OptLen; i+=olen ){
             switch (pTcpHdr->Options[i]) {
                 case TCPOPT_EOL:
                 case TCPOPT_NOP:
                     olen = 1;
                     break;

                 case TCPOPT_MAXSEG:
                     olen = (INT8) pTcpHdr->Options[i+1];
                     if (olen == TCPOLEN_MAXSEG ) {
                     // Get the MSS and notify our metrics routine
                         mss = pTcpHdr->Options[i+3]+pTcpHdr->Options[i+2]*256;
                         TcpValidateMetrics( pt, mss );
                     }
                     break;

                 case TCPOPT_SACKPERMITTED:
                     olen = TCPOPLEN_SACKPERMITTED;
                     if (((TcpFlags & TCP_SYN) ||
                         ((TcpFlags & TCP_SYN) && (TcpFlags & TCP_ACK))) &&
                         (pt->t_flags & TF_SACKPERMITTED)) {
                         pt->sackActive = 1;
                     }
                     break;

                 case TCPOPT_SACK:
                     olen = (INT8) pTcpHdr->Options[i+1];
                     if (pt->sackActive) {
                         processSackOptions(pt, pTcpHdr, i);
                     }
                     break;

                 default:
                     olen = (INT8) pTcpHdr->Options[i+1];
                     break;
            }
        }
    }

I recogniced a stall in the stack and saw that the stack stucked in the for loop. i was negative, so I guess olen was negtive too.

Is there a solution to that problem?