From: Kirill Isakov Date: Fri, 20 May 2022 12:41:01 +0000 (+0600) Subject: Don't retry outgoing connections if node is connected X-Git-Url: https://tinc-vpn.org/git/browse?a=commitdiff_plain;h=84b24109000ce66125038793df313205e5836b83;p=tinc Don't retry outgoing connections if node is connected --- diff --git a/src/net_socket.c b/src/net_socket.c index 982bc800..c8aa7882 100644 --- a/src/net_socket.c +++ b/src/net_socket.c @@ -671,17 +671,10 @@ void setup_outgoing_connection(outgoing_t *outgoing, bool verbose) { n->address_cache = open_address_cache(n); } - if(!n->connection) { - do_outgoing_connection(outgoing); - return; - } - - logger(DEBUG_CONNECTIONS, LOG_INFO, "Already connected to %s", n->name); - - if(n->connection->outgoing) { - list_delete(&outgoing_list, outgoing); + if(n->connection) { + logger(DEBUG_CONNECTIONS, LOG_INFO, "Already connected to %s", n->name); } else { - n->connection->outgoing = outgoing; + do_outgoing_connection(outgoing); } }