Changeset 1144


Ignore:
Timestamp:
Apr 4, 2007 10:13:07 AM (12 years ago)
Author:
bennylp
Message:

Fixed potential crash in ICE when adding peer reflexive candidate

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjnath/src/pjnath/ice_session.c

    r1141 r1144  
    913913    pj_assert(check->state >= PJ_ICE_SESS_CHECK_STATE_SUCCEEDED); 
    914914 
     915    /* 7.1.2.2.2.  Updating Pair States 
     916     *  
     917     * The agent sets the state of the pair that generated the check to 
     918     * Succeeded.  The success of this check might also cause the state of 
     919     * other checks to change as well.  The agent MUST perform the following 
     920     * two steps: 
     921     *  
     922     * 1.  The agent changes the states for all other Frozen pairs for the 
     923     * same media stream and same foundation to Waiting.  Typically 
     924     * these other pairs will have different component IDs but not 
     925     * always. 
     926     */ 
     927 
     928 
    915929    /* If there is at least one nominated pair in the valid list: 
    916930     * - The agent MUST remove all Waiting and Frozen pairs in the check 
     
    15831597 
    15841598        pj_ice_calc_foundation(ice->pool, &foundation, PJ_ICE_CAND_TYPE_PRFLX, 
    1585                                &lcand->base_addr); 
     1599                               &check->lcand->base_addr); 
     1600 
     1601        /* According to: 7.1.2.2.1. Discovering Peer Reflexive Candidates: 
     1602         * Its priority is set equal to the value of the PRIORITY attribute 
     1603         * in the Binding Request. 
     1604         * 
     1605         * I think the priority calculated by add_cand() should be the same 
     1606         * as the one calculated in perform_check(), so there's no need to 
     1607         * get the priority from the PRIORITY attribute. 
     1608         */ 
    15861609 
    15871610        /* Add new peer reflexive candidate */ 
    15881611        status = pj_ice_sess_add_cand(ice, lcand->comp_id,  
    1589                                  PJ_ICE_CAND_TYPE_PRFLX, 
    1590                                  65535, &foundation, 
    1591                                  &xaddr->sockaddr, &lcand->base_addr, NULL, 
    1592                                  sizeof(pj_sockaddr_in), &cand_id); 
     1612                                      PJ_ICE_CAND_TYPE_PRFLX, 
     1613                                      65535, &foundation, 
     1614                                      &xaddr->sockaddr,  
     1615                                      &check->lcand->base_addr, NULL, 
     1616                                      sizeof(pj_sockaddr_in), &cand_id); 
    15931617        if (status != PJ_SUCCESS) { 
    15941618            check_set_state(ice, check, PJ_ICE_SESS_CHECK_STATE_FAILED,  
     
    16011625        /* Update local candidate */ 
    16021626        lcand = &ice->lcand[cand_id]; 
     1627 
    16031628    } 
    16041629 
Note: See TracChangeset for help on using the changeset viewer.