Commit cf238352 authored by Youness Alaoui's avatar Youness Alaoui
Browse files

use the correct len for tcp-turn and memset the sockaddr to 0

parent c40725fd
...@@ -111,6 +111,7 @@ NICEAPI_EXPORT void ...@@ -111,6 +111,7 @@ NICEAPI_EXPORT void
nice_address_init (NiceAddress *addr) nice_address_init (NiceAddress *addr)
{ {
addr->s.addr.sa_family = AF_UNSPEC; addr->s.addr.sa_family = AF_UNSPEC;
memset (&addr->s, 0, sizeof(addr->s));
} }
NICEAPI_EXPORT NiceAddress * NICEAPI_EXPORT NiceAddress *
......
...@@ -424,7 +424,8 @@ nice_tcp_turn_socket_new ( ...@@ -424,7 +424,8 @@ nice_tcp_turn_socket_new (
fcntl (sockfd, F_SETFL, fcntl (sockfd, F_GETFL) | O_NONBLOCK); fcntl (sockfd, F_SETFL, fcntl (sockfd, F_GETFL) | O_NONBLOCK);
#endif #endif
name_len = name.ss_family == AF_INET? sizeof (struct sockaddr_in) :
sizeof(struct sockaddr_in6);
ret = connect (sockfd, (const struct sockaddr *)&name, name_len); ret = connect (sockfd, (const struct sockaddr *)&name, name_len);
#ifdef G_OS_WIN32 #ifdef G_OS_WIN32
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment