Changeset 5995 for pjproject/trunk/pjsip/src/pjsip/sip_resolve.c
- Timestamp:
- May 17, 2019 9:37:18 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip/src/pjsip/sip_resolve.c
r5984 r5995 277 277 svr_addr.count = 1; 278 278 if (ip_addr_ver == 4) { 279 if (af == pj_AF_INET6()) { 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() || PJSIP_MAX_RESOLVED_ADDRESSES > 1) 287 { 280 288 /* Generate a synthesized IPv6 address, if possible. */ 281 289 unsigned int count = 1; … … 288 296 ai[0].ai_addr.addr.sa_family == pj_AF_INET6()) 289 297 { 298 unsigned idx = 0; 299 300 if (target->type == PJSIP_TRANSPORT_UNSPECIFIED) { 301 idx = 1; 302 svr_addr.count++; 303 } 290 304 pj_sockaddr_init(pj_AF_INET6(), 291 &svr_addr.entry[ 0].addr,305 &svr_addr.entry[idx].addr, 292 306 NULL, 0); 293 svr_addr.entry[ 0].addr.ipv6.sin6_addr =307 svr_addr.entry[idx].addr.ipv6.sin6_addr = 294 308 ai[0].ai_addr.ipv6.sin6_addr; 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); 309 } else if (af == pj_AF_INET6()) { 310 svr_addr.count = 0; 311 status = PJ_ERESOLVE; 312 goto on_error; 300 313 } 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);306 314 } 307 315 } else {
Note: See TracChangeset
for help on using the changeset viewer.