Also don't use poll() on MacOS/X.
[tinc] / src / net_socket.c
index a7c7815..ce1e3aa 100644 (file)
@@ -63,7 +63,7 @@ static void configure_tcp(connection_t *c) {
        unsigned long arg = 1;
 
        if(ioctlsocket(c->socket, FIONBIO, &arg) != 0) {
-               logger(DEBUG_ALWAYS, LOG_ERR, "ioctlsocket for %s: %d", c->hostname, sockstrerror(sockerrno));
+               logger(DEBUG_ALWAYS, LOG_ERR, "ioctlsocket for %s: %s", c->hostname, sockstrerror(sockerrno));
        }
 #endif
 
@@ -282,7 +282,7 @@ void retry_outgoing(outgoing_t *outgoing) {
                outgoing->timeout = maxtimeout;
 
        timeout_set(&outgoing->ev, retry_outgoing_handler, outgoing);
-       event_add(&outgoing->ev, &(struct timeval){outgoing->timeout, 0});
+       event_add(&outgoing->ev, &(struct timeval){outgoing->timeout, rand() % 100000});
 
        logger(DEBUG_CONNECTIONS, LOG_NOTICE,
                           "Trying to re-establish outgoing connection in %d seconds",