Changeset 6044 for pjproject/trunk/pjsip/src/pjsip/sip_resolve.c
- Timestamp:
- Jul 26, 2019 5:40:42 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip/src/pjsip/sip_resolve.c
r6025 r6044 277 277 svr_addr.count = 1; 278 278 if (ip_addr_ver == 4) { 279 if (af == pj_AF_INET()) { 280 pj_sockaddr_init(pj_AF_INET(), &svr_addr.entry[0].addr, 281 NULL, 0); 282 pj_inet_pton(pj_AF_INET(), &target->addr.host, 283 &svr_addr.entry[0].addr.ipv4.sin_addr); 284 } 285 286 if (af == pj_AF_INET6() || 287 (type != PJSIP_TRANSPORT_LOOP_DGRAM && 288 PJSIP_MAX_RESOLVED_ADDRESSES > 1)) 289 { 279 if (af == pj_AF_INET6()) { 290 280 /* Generate a synthesized IPv6 address, if possible. */ 291 281 unsigned int count = 1; … … 298 288 ai[0].ai_addr.addr.sa_family == pj_AF_INET6()) 299 289 { 300 unsigned idx = 0;301 302 if (af != pj_AF_INET6()) {303 /* Return IPv4 and IPv6 addresses */304 idx = 1;305 svr_addr.count++;306 }307 290 pj_sockaddr_init(pj_AF_INET6(), 308 &svr_addr.entry[ idx].addr,291 &svr_addr.entry[0].addr, 309 292 NULL, 0); 310 svr_addr.entry[ idx].addr.ipv6.sin6_addr =293 svr_addr.entry[0].addr.ipv6.sin6_addr = 311 294 ai[0].ai_addr.ipv6.sin6_addr; 312 } else if (af == pj_AF_INET6()) { 313 svr_addr.count = 0; 314 status = PJ_ERESOLVE; 315 goto on_error; 295 } else { 296 pj_sockaddr_init(pj_AF_INET(), 297 &svr_addr.entry[0].addr, NULL, 0); 298 pj_inet_pton(pj_AF_INET(), &target->addr.host, 299 &svr_addr.entry[0].addr.ipv4.sin_addr); 316 300 } 301 } else { 302 pj_sockaddr_init(pj_AF_INET(), &svr_addr.entry[0].addr, 303 NULL, 0); 304 pj_inet_pton(pj_AF_INET(), &target->addr.host, 305 &svr_addr.entry[0].addr.ipv4.sin_addr); 317 306 } 318 307 } else {
Note: See TracChangeset
for help on using the changeset viewer.