]> git.meshlink.io Git - meshlink/commitdiff
terminate_connection(): only kill c->node->connection if it is pointing
authorSven-Haegar Koch <haegar@sdinet.de>
Fri, 20 Apr 2012 23:51:36 +0000 (01:51 +0200)
committerGuus Sliepen <guus@tinc-vpn.org>
Tue, 8 May 2012 14:17:55 +0000 (16:17 +0200)
to the same connection

src/net.c

index 2565be113506502626af2c65ff49c7cb8cf7b61c..58db16e29f1d26778a6a649adcea0af1f49b448f 100644 (file)
--- 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) {