Always try next Address when an outgoing connection fails to authenticate.
[oweals/tinc.git] / src / net.c
index 6979083f1948690d5f468b2ce45d2c43be5d82f8..0496a864e4dd4c028a07ab7bf4f52c353471c02e 100644 (file)
--- a/src/net.c
+++ b/src/net.c
@@ -204,18 +204,14 @@ void terminate_connection(connection_t *c, bool report) {
                }
        }
 
+       free_connection_partially(c);
+
        /* Check if this was our outgoing connection */
 
        if(c->outgoing) {
-               retry_outgoing(c->outgoing);
-               c->outgoing = NULL;
+               c->status.remove = false;
+               do_outgoing_connection(c);      
        }
-
-       free(c->outbuf);
-       c->outbuf = NULL;
-       c->outbuflen = 0;
-       c->outbufsize = 0;
-       c->outbufstart = 0;
 }
 
 /*