Changeset 5562 for pjproject/trunk/pjnath/src/pjnath/ice_strans.c
- Timestamp:
- Mar 3, 2017 2:11:02 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjnath/src/pjnath/ice_strans.c
r5521 r5562 232 232 pj_bzero(cfg, sizeof(*cfg)); 233 233 234 cfg->af = pj_AF_INET(); 234 235 pj_stun_config_init(&cfg->stun_cfg, NULL, 0, NULL, NULL); 235 236 pj_ice_strans_stun_cfg_default(&cfg->stun); … … 346 347 if (comp->cand_list[i].type == PJ_ICE_CAND_TYPE_SRFLX) { 347 348 comp->default_cand = i; 348 break; 349 if (ice_st->cfg.af == pj_AF_UNSPEC() || 350 comp->cand_list[i].base_addr.addr.sa_family == 351 ice_st->cfg.af) 352 { 353 break; 354 } 349 355 } 350 356 } … … 548 554 549 555 /* Set default candidate to srflx */ 550 comp->default_cand = (unsigned)(cand - comp->cand_list); 556 if (comp->cand_list[comp->default_cand].type != PJ_ICE_CAND_TYPE_SRFLX 557 || (ice_st->cfg.af != pj_AF_UNSPEC() && 558 comp->cand_list[comp->default_cand].base_addr.addr.sa_family 559 != ice_st->cfg.af)) 560 { 561 comp->default_cand = (unsigned)(cand - comp->cand_list); 562 } 551 563 552 564 pj_log_pop_indent(); … … 639 651 cand->type, &cand->base_addr); 640 652 653 /* Set default candidate with the preferred default 654 * address family 655 */ 656 if (comp->ice_st->cfg.af != pj_AF_UNSPEC() && 657 comp->cand_list[comp->default_cand].addr.addr.sa_family != 658 ice_st->cfg.af) 659 { 660 comp->default_cand = (unsigned)(cand - comp->cand_list); 661 } 662 641 663 PJ_LOG(4,(ice_st->obj_name, 642 664 "Comp %d/%d: host candidate %s (tpid=%d) added", … … 2004 2026 2005 2027 /* Set default candidate to relay */ 2006 comp->default_cand = (unsigned)(cand - comp->cand_list); 2028 if (comp->cand_list[comp->default_cand].type!=PJ_ICE_CAND_TYPE_RELAYED 2029 || (comp->ice_st->cfg.af != pj_AF_UNSPEC() && 2030 comp->cand_list[comp->default_cand].addr.addr.sa_family 2031 != comp->ice_st->cfg.af)) 2032 { 2033 comp->default_cand = (unsigned)(cand - comp->cand_list); 2034 } 2007 2035 2008 2036 /* Prefer IPv4 relay as default candidate for better connectivity 2009 2037 * with IPv4 endpoints. 2010 2038 */ 2039 /* 2011 2040 if (cand->addr.addr.sa_family != pj_AF_INET()) { 2012 2041 for (i=0; i<comp->cand_cnt; ++i) { … … 2020 2049 } 2021 2050 } 2051 */ 2022 2052 2023 2053 PJ_LOG(4,(comp->ice_st->obj_name,
Note: See TracChangeset
for help on using the changeset viewer.