X-Git-Url: https://tinc-vpn.org/git/browse?a=blobdiff_plain;ds=sidebyside;f=src%2Fnet_socket.c;h=4fbcf57ddaa30e0d6f03690425c4d15ed9697bc4;hb=536fe3ffcdc4c894ed986dfb5fdc0d6f78d6fe25;hp=30ab79e2b98ffdfa5f1eb7cd3bb12b7775a95af7;hpb=04543a57e73e29c3e2a1968fd330f03c94dd6059;p=tinc diff --git a/src/net_socket.c b/src/net_socket.c index 30ab79e2..4fbcf57d 100644 --- a/src/net_socket.c +++ b/src/net_socket.c @@ -59,14 +59,14 @@ static void configure_tcp(connection_t *c) { int flags = fcntl(c->socket, F_GETFL); if(fcntl(c->socket, F_SETFL, flags | O_NONBLOCK) < 0) { - logger(DEBUG_ALWAYS, LOG_ERR, "fcntl for %s: %s", c->hostname, strerror(errno)); + logger(DEBUG_ALWAYS, LOG_ERR, "fcntl for %s fd %d: %s", c->hostname, c->socket, strerror(errno)); } #elif defined(WIN32) unsigned long arg = 1; if(ioctlsocket(c->socket, FIONBIO, &arg) != 0) { - logger(DEBUG_ALWAYS, LOG_ERR, "ioctlsocket for %s: %s", c->hostname, sockstrerror(sockerrno)); + logger(DEBUG_ALWAYS, LOG_ERR, "ioctlsocket for %s fd %d: %s", c->hostname, c->socket, sockstrerror(sockerrno)); } #endif @@ -508,7 +508,7 @@ begin: connection_t *c = new_connection(); c->outgoing = outgoing; - c->address = *sa; + memcpy(&c->address, sa, SALEN(sa->sa)); c->hostname = sockaddr2hostname(&c->address); logger(DEBUG_CONNECTIONS, LOG_INFO, "Trying to connect to %s (%s)", outgoing->node->name, c->hostname);