Changeset 3834


Ignore:
Timestamp:
Oct 21, 2011 9:39:40 AM (13 years ago)
Author:
bennylp
Message:

Fixed #1391: Missing CSeq check for incoming ACK in an INVITE session (thanks Ilya Kalinin for the report)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/branches/1.x/pjsip/src/pjsip-ua/sip_inv.c

    r3598 r3834  
    456456    if (method->id == PJSIP_ACK_METHOD && inv) { 
    457457 
     458        /* Ignore if we don't have INVITE in progress */ 
     459        if (!inv->invite_tsx) { 
     460            return PJ_TRUE; 
     461        } 
     462 
    458463        /* Ignore ACK if pending INVITE transaction has not finished. */ 
    459         if (inv->invite_tsx &&  
    460             inv->invite_tsx->state < PJSIP_TSX_STATE_COMPLETED) 
    461         { 
     464        if (inv->invite_tsx->state < PJSIP_TSX_STATE_COMPLETED) { 
    462465            return PJ_TRUE; 
    463466        } 
    464467 
     468        /* Ignore ACK with different CSeq 
     469         * https://trac.pjsip.org/repos/ticket/1391 
     470         */ 
     471        if (rdata->msg_info.cseq->cseq != inv->invite_tsx->cseq) { 
     472            return PJ_TRUE; 
     473        } 
     474 
    465475        /* Terminate INVITE transaction, if it's still present. */ 
    466         if (inv->invite_tsx &&  
    467             inv->invite_tsx->state <= PJSIP_TSX_STATE_COMPLETED) 
    468         { 
     476        if (inv->invite_tsx->state <= PJSIP_TSX_STATE_COMPLETED) { 
    469477            /* Before we terminate INVITE transaction, process the SDP 
    470478             * in the ACK request, if any.  
Note: See TracChangeset for help on using the changeset viewer.