X-Git-Url: https://tinc-vpn.org/git/browse?a=blobdiff_plain;f=src%2Fnet.c;h=295546df6068a5e63e2c4701d2d5c56d94f4a650;hb=62b61a1b7c2382b1bade142b3a41a9b27c1fd40d;hp=2565be113506502626af2c65ff49c7cb8cf7b61c;hpb=a96c4f016c9fff2392d85f762e16f5430c0b6463;p=tinc diff --git a/src/net.c b/src/net.c index 2565be11..295546df 100644 --- a/src/net.c +++ b/src/net.c @@ -113,7 +113,7 @@ void terminate_connection(connection_t *c, bool report) { c->status.active = false; - if(c->node) + if(c->node && c->node->connection == c) c->node->connection = NULL; if(c->edge) { @@ -145,8 +145,10 @@ void terminate_connection(connection_t *c, bool report) { /* Check if this was our outgoing connection */ if(c->outgoing) { - do_outgoing_connection(c); - } + do_outgoing_connection(c); + } else { + connection_del(c); + } } /*