From: Guus Sliepen Date: Tue, 27 Jun 2017 21:36:52 +0000 (+0200) Subject: Don't forget about outgoing connections on host file read errors. X-Git-Tag: release-1.0.32~4 X-Git-Url: https://tinc-vpn.org/git/browse?a=commitdiff_plain;h=9a5e289493541c80890700b03b93ba5a1ba91905;p=tinc Don't forget about outgoing connections on host file read errors. If the host config file for an outgoing connection cannot be read, or if it doesn't contain any Address, don't forget about the ConnectTo, but go straight to MaxTimeout seconds for retries. --- diff --git a/src/net_socket.c b/src/net_socket.c index 80ae6778..284bab74 100644 --- a/src/net_socket.c +++ b/src/net_socket.c @@ -1,7 +1,7 @@ /* net_socket.c -- Handle various kinds of sockets. Copyright (C) 1998-2005 Ivo Timmermans, - 2000-2015 Guus Sliepen + 2000-2017 Guus Sliepen 2006 Scott Lamb 2009 Florian Forster @@ -556,13 +556,20 @@ void setup_outgoing_connection(outgoing_t *outgoing) { c->outcompression = myself->connection->outcompression; init_configuration(&c->config_tree); - read_connection_config(c); + if(!read_connection_config(c)) { + free_connection(c); + outgoing->timeout = maxtimeout; + retry_outgoing(outgoing); + return; + } outgoing->cfg = lookup_config(c->config_tree, "Address"); if(!outgoing->cfg) { logger(LOG_ERR, "No address specified for %s", c->name); free_connection(c); + outgoing->timeout = maxtimeout; + retry_outgoing(outgoing); return; }