+Sun Jun 9 18:58:25 EEST 2002 Pekka Riikonen <priikone@silcnet.org>
+
+ * The length arguments in bind() and connect() were wrong
+ and fixed now to used SIZEOF_SOCKADDR in the
+ lib/silcutil/unix/silcunixutil.c.
+
Tue Jun 4 18:36:05 EEST 2002 Pekka Riikonen <priikone@silcnet.org>
* Fixed detach timeout handling to use Client ID and not
/* Set sockaddr for local listener, and try to bind it. */
if (silc_net_set_sockaddr(&local, local_ip, 0))
- bind(sock, &local.sa, sizeof(local));
+ bind(sock, &local.sa, SIZEOF_SOCKADDR(local));
}
/* Connect to the host */
- rval = connect(sock, &desthost.sa, sizeof(desthost));
+ rval = connect(sock, &desthost.sa, SIZEOF_SOCKADDR(desthost));
if (rval < 0) {
SILC_LOG_ERROR(("Cannot connect to remote host: %s", strerror(errno)));
shutdown(sock, 2);
/* Set sockaddr for local listener, and try to bind it. */
if (silc_net_set_sockaddr(&local, local_ip, 0))
- bind(sock, &local.sa, sizeof(local));
+ bind(sock, &local.sa, SIZEOF_SOCKADDR(local));
}
/* Set the socket to non-blocking mode */
silc_net_set_socket_nonblock(sock);
/* Connect to the host */
- rval = connect(sock, &desthost.sa, sizeof(desthost));
+ rval = connect(sock, &desthost.sa, SIZEOF_SOCKADDR(desthost));
if (rval < 0) {
if (errno != EINPROGRESS) {
SILC_LOG_ERROR(("Cannot connect to remote host: %s", strerror(errno)));