Closed zwetan closed 8 years ago
in the _open()
method we use hints.ai_family = AF_UNSPEC;
to support both IPv4 and IPv6
when IPv6 is used the crash occurs because later in the code
_remotePort = ntohs( _info.ai_addr.sin_port );
for an IPv6 it should be
_remotePort = ntohs( _info.ai_addr.sin6_port );
as ai_addr
can be either sockaddr_in
or sockaddr_in6
fix is to test the family
if( _info.ai_family == AF_INET )
{
// IPv4
}
else
{
// IPv6 eg. _info.ai_family == AF_INET6
}
quick workaround, update
hints.ai_family = AF_INET;
to force IPv4
arf off course same problem occurs with _findLocalAddressAndPort()
BSDSocketHitSender
crash