Changeset 5311 for pjproject/trunk/pjsip/src/pjsip/sip_transport_udp.c
- Timestamp:
- May 20, 2016 4:17:00 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip/src/pjsip/sip_transport_udp.c
r5284 r5311 161 161 rdata->pkt_info.zero = 0; 162 162 pj_gettimeofday(&rdata->pkt_info.timestamp); 163 if (src_addr->addr.sa_family == pj_AF_INET()) { 164 pj_ansi_strcpy(rdata->pkt_info.src_name, 165 pj_inet_ntoa(src_addr->ipv4.sin_addr)); 166 rdata->pkt_info.src_port = pj_ntohs(src_addr->ipv4.sin_port); 167 } else { 168 pj_inet_ntop(pj_AF_INET6(), 169 pj_sockaddr_get_addr(&rdata->pkt_info.src_addr), 170 rdata->pkt_info.src_name, 171 sizeof(rdata->pkt_info.src_name)); 172 rdata->pkt_info.src_port = pj_ntohs(src_addr->ipv6.sin6_port); 173 } 163 pj_sockaddr_print(src_addr, rdata->pkt_info.src_name, 164 sizeof(rdata->pkt_info.src_name), 0); 165 rdata->pkt_info.src_port = pj_sockaddr_get_port(src_addr); 174 166 175 167 size_eaten = … … 518 510 return status; 519 511 520 pj_strcpy2(&bound_name->host, pj_inet_ntoa(hostip.ipv4.sin_addr)); 512 status = pj_inet_ntop(pj_AF_INET(), &hostip.ipv4.sin_addr, 513 hostbuf, hostbufsz); 521 514 } else { 522 515 /* Otherwise use bound address. */ 523 pj_strcpy2(&bound_name->host, 524 pj_inet_ntoa(tmp_addr.ipv4.sin_addr)); 525 status = PJ_SUCCESS; 516 status = pj_inet_ntop(pj_AF_INET(), &tmp_addr.ipv4.sin_addr, 517 hostbuf, hostbufsz); 526 518 } 527 519 … … 543 535 pj_sockaddr_get_addr(&tmp_addr), 544 536 hostbuf, hostbufsz); 545 if (status == PJ_SUCCESS) { 546 bound_name->host.slen = pj_ansi_strlen(hostbuf); 547 }537 } 538 if (status == PJ_SUCCESS) { 539 bound_name->host.slen = pj_ansi_strlen(hostbuf); 548 540 } 549 541
Note: See TracChangeset
for help on using the changeset viewer.