Changeset 3053


Ignore:
Timestamp:
Jan 8, 2010 5:12:05 PM (10 years ago)
Author:
bennylp
Message:

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
File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip/src/pjsip/sip_resolve.c

    r3049 r3053  
    232232            /* Target is an IP address, no need to resolve */ 
    233233            if (ip_addr_ver == 4) { 
    234                 svr_addr.entry[0].addr.addr.sa_family = pj_AF_INET(); 
     234                pj_sockaddr_init(pj_AF_INET(), &svr_addr.entry[0].addr,  
     235                                 NULL, 0); 
    235236                pj_inet_aton(&target->addr.host, 
    236237                             &svr_addr.entry[0].addr.ipv4.sin_addr); 
    237238            } else { 
    238                 svr_addr.entry[0].addr.addr.sa_family = pj_AF_INET6(); 
     239                pj_sockaddr_init(pj_AF_INET6(), &svr_addr.entry[0].addr,  
     240                                 NULL, 0); 
    239241                pj_inet_pton(pj_AF_INET6(), &target->addr.host, 
    240                         &svr_addr.entry[0].addr.ipv4.sin_addr); 
     242                             &svr_addr.entry[0].addr.ipv6.sin6_addr); 
    241243            } 
    242244        } else { 
Note: See TracChangeset for help on using the changeset viewer.