From: Guus Sliepen Date: Sat, 6 Oct 2012 19:16:17 +0000 (+0200) Subject: When terminating, keep control connections open until the end. X-Git-Tag: release-1.1pre3~27 X-Git-Url: https://tinc-vpn.org/git/browse?a=commitdiff_plain;h=e05371346548dee977d4ee45e12e3058e749afb6;p=tinc When terminating, keep control connections open until the end. This ensures all device files and listening sockets have been closed before tincctl gets notified of tincd's termination. --- diff --git a/src/net_setup.c b/src/net_setup.c index 2a67d432..f07bdda4 100644 --- a/src/net_setup.c +++ b/src/net_setup.c @@ -963,6 +963,9 @@ void close_network_connections(void) { for(node = connection_tree->head; node; node = next) { next = node->next; c = node->data; + /* Keep control connections open until the end, so they know when we really terminated */ + if(c->status.control) + c->socket = -1; c->outgoing = NULL; terminate_connection(c, false); }