Changeset 5476
- Timestamp:
- Oct 31, 2016 1:27:34 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip/src/pjsip/sip_resolve.c
r5471 r5476 277 277 /* Target is an IP address, no need to resolve */ 278 278 if (ip_addr_ver == 4) { 279 pj_sockaddr_init(pj_AF_INET(), &svr_addr.entry[0].addr, 280 NULL, 0); 281 pj_inet_pton(pj_AF_INET(), &target->addr.host, 282 &svr_addr.entry[0].addr.ipv4.sin_addr); 279 if (af == pj_AF_INET6()) { 280 /* Generate a synthesized IPv6 address, if possible. */ 281 unsigned int count = 1; 282 pj_addrinfo ai[1]; 283 pj_status_t status; 284 285 status = pj_getaddrinfo(pj_AF_INET6(), 286 &target->addr.host, &count, ai); 287 if (status == PJ_SUCCESS && count > 0 && 288 ai[0].ai_addr.addr.sa_family == pj_AF_INET6()) 289 { 290 pj_sockaddr_init(pj_AF_INET6(), 291 &svr_addr.entry[0].addr, 292 NULL, 0); 293 svr_addr.entry[0].addr.ipv6.sin6_addr = 294 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); 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); 306 } 283 307 } else { 284 308 pj_sockaddr_init(pj_AF_INET6(), &svr_addr.entry[0].addr,
Note: See TracChangeset
for help on using the changeset viewer.