Ignore:
Timestamp:
Jul 26, 2019 9:32:14 AM (5 years ago)
Author:
nanang
Message:

Close #2217: Omit deprecated IPv6 addresses from ICE candidates.

File:
1 edited

Legend:

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

    r5997 r6045  
    683683    } else { 
    684684        pj_sockaddr def_addr; 
    685         pj_uint16_t port = pj_sockaddr_get_port(&info->bound_addr);  
     685        pj_uint16_t port = pj_sockaddr_get_port(&info->bound_addr); 
     686        pj_enum_ip_option enum_opt; 
    686687        unsigned i; 
    687688 
     
    698699         
    699700        /* Enum all IP interfaces in the host */ 
     701        pj_enum_ip_option_default(&enum_opt); 
     702        enum_opt.af = stun_sock->af; 
     703        enum_opt.omit_deprecated_ipv6 = PJ_TRUE; 
    700704        info->alias_cnt = PJ_ARRAY_SIZE(info->aliases); 
    701         status = pj_enum_ip_interface(stun_sock->af, &info->alias_cnt,  
    702                                       info->aliases); 
     705        status = pj_enum_ip_interface2(&enum_opt, &info->alias_cnt,  
     706                                       info->aliases); 
     707        if (status == PJ_ENOTSUP) { 
     708            /* Try again without omitting deprecated IPv6 addresses */ 
     709            enum_opt.omit_deprecated_ipv6 = PJ_FALSE; 
     710            status = pj_enum_ip_interface2(&enum_opt, &info->alias_cnt,  
     711                                           info->aliases); 
     712        } 
     713 
    703714        if (status != PJ_SUCCESS) { 
    704715            /* If enumeration fails, just return the default address */ 
Note: See TracChangeset for help on using the changeset viewer.