Changeset 3035 for pjproject


Ignore:
Timestamp:
Dec 22, 2009 1:00:22 PM (15 years ago)
Author:
bennylp
Message:

Misc (#1003): added protection against situation when pj_sock_getsockname() returns PJ_SUCCESS but 0.0.0.0 is reported as the socket address, potentially causing SIP TCP transport to put 0.0.0.0 or empty Via address. Not sure if this situation could happen though.

File:
1 edited

Legend:

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

    r2966 r3035  
    12811281        pj_sockaddr_in *tp_addr = (pj_sockaddr_in*)&tcp->base.local_addr; 
    12821282 
    1283         if (tp_addr->sin_addr.s_addr != addr.sin_addr.s_addr) { 
     1283        if (pj_sockaddr_has_addr(&addr) && 
     1284            tp_addr->sin_addr.s_addr != addr.sin_addr.s_addr)  
     1285        { 
    12841286            tp_addr->sin_addr.s_addr = addr.sin_addr.s_addr; 
    12851287            tp_addr->sin_port = addr.sin_port; 
Note: See TracChangeset for help on using the changeset viewer.