Changeset 5249 for pjproject


Ignore:
Timestamp:
Feb 29, 2016 8:24:58 AM (8 years ago)
Author:
ming
Message:

Re #1882 (misc): Various IPv6 fixes:

  • For contact rewrite feature, when contact address is IPv6, it shouldn't be replaced with IPv4 address
  • If tp_type is already of type IPv6, adding it with PJSIP_TRANSPORT_IPV6 will result in an invalid transport type
  • Add check if pj_getaddrinfo() returns zero address.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip/src/pjsua-lib/pjsua_acc.c

    r5217 r5249  
    16461646                                   &recv_addr); 
    16471647    if (status == PJ_SUCCESS) { 
    1648         /* Compare the addresses as sockaddr according to the ticket above */ 
    1649         matched = (uri->port == rport && 
     1648        /* Compare the addresses as sockaddr according to the ticket above, 
     1649         * but only if they have the same family (ipv4 vs ipv4, or 
     1650         * ipv6 vs ipv6) 
     1651         */ 
     1652        matched = (contact_addr.addr.sa_family != recv_addr.addr.sa_family) || 
     1653                  (uri->port == rport && 
    16501654                   pj_sockaddr_cmp(&contact_addr, &recv_addr)==0); 
    16511655    } else { 
     
    31003104     */ 
    31013105    if (pj_strchr(&sip_uri->host, ':')) 
    3102         tp_type = (pjsip_transport_type_e)(((int)tp_type) + PJSIP_TRANSPORT_IPV6); 
     3106        tp_type = (pjsip_transport_type_e)(((int)tp_type) | 
     3107                  PJSIP_TRANSPORT_IPV6); 
    31033108 
    31043109    flag = pjsip_transport_get_flag_from_type(tp_type); 
     
    31653170            af = (dinfo.type & PJSIP_TRANSPORT_IPV6)? PJ_AF_INET6 : PJ_AF_INET; 
    31663171            status = pj_getaddrinfo(af, &dinfo.addr.host, &cnt, &ai); 
     3172            if (cnt == 0) status = PJ_ENOTSUP; 
    31673173        } 
    31683174 
Note: See TracChangeset for help on using the changeset viewer.