diff options
author | Benny Prijono <bennylp@teluu.com> | 2010-01-08 17:12:05 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2010-01-08 17:12:05 +0000 |
commit | 6a804ddc4bfee4bd68f3cf2e2e948c6ed80af733 (patch) | |
tree | c4cc00281d8478a668a073096487c971fe2807be | |
parent | 8944abd8923f1dce47876251d285ddaea6ad27bf (diff) |
More ticket #1013: PJSIP resolver should not try to resolve the target if IP address is given (thanks Emil Sturniolo for the report)
- fixed bug with IPv6
- also fixed bug with not fully initializing socket address, causing assertion on pjsip-test and also potentially will cause error on MacOS X due to sin_zero_len not being zeroed
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@3053 74dad513-b988-da41-8d7b-12977e46ad98
-rw-r--r-- | pjsip/src/pjsip/sip_resolve.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/pjsip/src/pjsip/sip_resolve.c b/pjsip/src/pjsip/sip_resolve.c index 4ec74a78..037ad92c 100644 --- a/pjsip/src/pjsip/sip_resolve.c +++ b/pjsip/src/pjsip/sip_resolve.c @@ -231,13 +231,15 @@ PJ_DEF(void) pjsip_resolve( pjsip_resolver_t *resolver, if (ip_addr_ver != 0) { /* Target is an IP address, no need to resolve */ if (ip_addr_ver == 4) { - svr_addr.entry[0].addr.addr.sa_family = pj_AF_INET(); + pj_sockaddr_init(pj_AF_INET(), &svr_addr.entry[0].addr, + NULL, 0); pj_inet_aton(&target->addr.host, &svr_addr.entry[0].addr.ipv4.sin_addr); } else { - svr_addr.entry[0].addr.addr.sa_family = pj_AF_INET6(); + pj_sockaddr_init(pj_AF_INET6(), &svr_addr.entry[0].addr, + NULL, 0); pj_inet_pton(pj_AF_INET6(), &target->addr.host, - &svr_addr.entry[0].addr.ipv4.sin_addr); + &svr_addr.entry[0].addr.ipv6.sin6_addr); } } else { pj_addrinfo ai; |