Ignore:
Timestamp:
Oct 25, 2009 10:50:17 AM (10 years ago)
Author:
bennylp
Message:

More ticket #950 (QoS):

  • fixed wrong DSCP field operation with sock_qos_bsd.c backend
  • tested on Linux for SIP (UDP/TCP), UDP RTP/RTCP, and ICE
  • renamed 801_1_P names to SO_PRIO
  • changed a bit of doxygen documentation (the title etc)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjlib/src/pj/sock_qos_bsd.c

    r2966 r2967  
    4242    /* Set TOS/DSCP */ 
    4343    if (param->flags & PJ_QOS_PARAM_HAS_DSCP) { 
    44         int val = param->dscp_val; 
     44        /* Value is dscp_val << 2 */ 
     45        int val = (param->dscp_val << 2); 
    4546        status = pj_sock_setsockopt(sock, pj_SOL_IP(), pj_IP_TOS(),  
    4647                                    &val, sizeof(val)); 
     
    5253 
    5354    /* Set SO_PRIORITY */ 
    54     if (param->flags & PJ_QOS_PARAM_HAS_802_1_P) { 
     55    if (param->flags & PJ_QOS_PARAM_HAS_SO_PRIO) { 
    5556        int val = param->so_prio; 
    5657        status = pj_sock_setsockopt(sock, pj_SOL_SOCKET(), pj_SO_PRIORITY(), 
    5758                                    &val, sizeof(val)); 
    5859        if (status != PJ_SUCCESS) { 
    59             param->flags &= ~(PJ_QOS_PARAM_HAS_802_1_P); 
     60            param->flags &= ~(PJ_QOS_PARAM_HAS_SO_PRIO); 
    6061            last_err = status; 
    6162        } 
     
    9495    if (status == PJ_SUCCESS) { 
    9596        p_param->flags |= PJ_QOS_PARAM_HAS_DSCP; 
    96         p_param->dscp_val = (pj_uint8_t)val; 
     97        p_param->dscp_val = (pj_uint8_t)(val >> 2); 
    9798    } else { 
    9899        last_err = status; 
     
    104105                                &val, &optlen); 
    105106    if (status == PJ_SUCCESS) { 
    106         p_param->flags |= PJ_QOS_PARAM_HAS_802_1_P; 
     107        p_param->flags |= PJ_QOS_PARAM_HAS_SO_PRIO; 
    107108        p_param->so_prio = (pj_uint8_t)val; 
    108109    } else { 
     
    129130 
    130131#endif  /* PJ_QOS_IMPLEMENTATION */ 
     132 
Note: See TracChangeset for help on using the changeset viewer.