Always try next Address when an outgoing connection fails to authenticate.
[tinc] / src / net.c
index 6979083..0496a86 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;
 }
 
 /*