Fix length of argument for connect() to work with IPv6
This line was resulting in the sizeof(struct socketaddr) connect_addr_len = sizeof(*addr->ai_addr); The correct syntax is to explicitly get the sizeof(struct sockaddr_in6) since we are dealing with IPv6 addresses.
This commit is contained in:
Родитель
ca14543a46
Коммит
6dfd032d39
|
@ -311,7 +311,7 @@ static int initiate_socket_connection(SOCKET_IO_INSTANCE* socket_io_instance)
|
|||
else
|
||||
{
|
||||
connect_addr = (struct sockaddr_in6*) addr->ai_addr;
|
||||
connect_addr_len = sizeof(*addr->ai_addr);
|
||||
connect_addr_len = sizeof(struct sockaddr_in6);
|
||||
result = 0;
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче