Fix retrying outgoing connections.
[tinc] / src / net_socket.c
index ec774f6..7ef8193 100644 (file)
@@ -231,7 +231,7 @@ int setup_vpn_in_socket(const sockaddr_t *sa) {
 }
 
 static void retry_outgoing_handler(int fd, short events, void *data) {
-       do_outgoing_connection(data);
+       setup_outgoing_connection(data);
 }
 
 void retry_outgoing(outgoing_t *outgoing) {
@@ -274,8 +274,9 @@ begin:
                if(!c->outgoing->cfg) {
                        ifdebug(CONNECTIONS) logger(LOG_ERR, _("Could not set up a meta connection to %s"),
                                           c->name);
-                       c->status.remove = true;
                        retry_outgoing(c->outgoing);
+                       c->outgoing = NULL;
+                       connection_del(c);
                        return;
                }