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 2565be1..58db16e 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) {