- Timestamp:
- Jun 25, 2009 12:42:03 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/branches/1.0/pjnath/src/pjnath/stun_sock.c
r2531 r2808 535 535 pj_sockaddr_cp(&info->aliases[0], &info->bound_addr); 536 536 } else { 537 pj_sockaddr def_addr; 538 pj_uint16_t port = pj_sockaddr_get_port(&info->bound_addr); 537 539 unsigned i; 538 540 541 /* Get the default address */ 542 status = pj_gethostip(stun_sock->af, &def_addr); 543 if (status != PJ_SUCCESS) 544 return status; 545 546 pj_sockaddr_set_port(&def_addr, port); 547 539 548 /* Enum all IP interfaces in the host */ 540 549 info->alias_cnt = PJ_ARRAY_SIZE(info->aliases); … … 546 555 /* Set the port number for each address. 547 556 */ 548 if (stun_sock->af == pj_AF_INET()) { 549 for (i=0; i<info->alias_cnt; ++i) { 550 pj_sockaddr_set_port(&info->aliases[i], 551 pj_sockaddr_get_port(&info->bound_addr)); 557 for (i=0; i<info->alias_cnt; ++i) { 558 pj_sockaddr_set_port(&info->aliases[i], port); 559 } 560 561 /* Put the default IP in the first slot */ 562 for (i=0; i<info->alias_cnt; ++i) { 563 if (pj_sockaddr_cmp(&info->aliases[i], &def_addr)==0) { 564 if (i!=0) { 565 pj_sockaddr_cp(&info->aliases[i], &info->aliases[0]); 566 pj_sockaddr_cp(&info->aliases[0], &def_addr); 567 } 568 break; 552 569 } 553 570 }
Note: See TracChangeset
for help on using the changeset viewer.