Skip to content
Snippets Groups Projects
  • Iain Sandoe's avatar
    99fcd602
    libcody: Do not use a dummy port number in getaddrinfo(). · 99fcd602
    Iain Sandoe authored
    
    the getaddrinfo() requires either a non-null name for the server or
    a port service / number.  In the code that opens a connection we have
    been calling this with a dummy port number of "0".  Unfortunately this
    triggers a bug in some BSD versions and OSes importing that code.
    
    In this part of the code we do not really need a port number, since it
    is not reasonable to open a connection to an unspecified host.
    
    Setting hints info field to 0, and the servname parm to nullptr works
    around the BSD bug in this case.
    
    Signed-off-by: default avatarIain Sandoe <iain@sandoe.co.uk>
    
    libcody/ChangeLog:
    
    	* netclient.cc (OpenInet6): Do not provide a dummy port number
    	in the getaddrinfo() call.
    99fcd602
    History
    libcody: Do not use a dummy port number in getaddrinfo().
    Iain Sandoe authored
    
    the getaddrinfo() requires either a non-null name for the server or
    a port service / number.  In the code that opens a connection we have
    been calling this with a dummy port number of "0".  Unfortunately this
    triggers a bug in some BSD versions and OSes importing that code.
    
    In this part of the code we do not really need a port number, since it
    is not reasonable to open a connection to an unspecified host.
    
    Setting hints info field to 0, and the servname parm to nullptr works
    around the BSD bug in this case.
    
    Signed-off-by: default avatarIain Sandoe <iain@sandoe.co.uk>
    
    libcody/ChangeLog:
    
    	* netclient.cc (OpenInet6): Do not provide a dummy port number
    	in the getaddrinfo() call.