X-Git-Url: https://tinc-vpn.org/git/browse?a=blobdiff_plain;f=src%2Fconnection.c;h=5a7c43b860c4a14bc4bd11b75953eac301adcc30;hb=1545909dcb3ac618754486f4ccd4d8f237d64bb7;hp=92a9f48ef0517e53ae52c38f9935adb3392a58fd;hpb=f6e87ab476a0faf8b124ecaaa27f967d825e6457;p=tinc diff --git a/src/connection.c b/src/connection.c index 92a9f48e..5a7c43b8 100644 --- a/src/connection.c +++ b/src/connection.c @@ -25,10 +25,9 @@ #include "cipher.h" #include "conf.h" #include "control_common.h" -#include "list.h" #include "logger.h" +#include "net.h" #include "rsa.h" -#include "subnet.h" #include "utils.h" #include "xalloc.h" @@ -44,7 +43,10 @@ void init_connections(void) { void exit_connections(void) { list_delete_list(connection_list); + connection_list = NULL; + free_connection(everyone); + everyone = NULL; } connection_t *new_connection(void) { @@ -68,6 +70,7 @@ void free_connection(connection_t *c) { ecdsa_free(c->ecdsa); free(c->hischallenge); + free(c->mychallenge); buffer_clear(&c->inbuf); buffer_clear(&c->outbuf); @@ -75,7 +78,11 @@ void free_connection(connection_t *c) { io_del(&c->io); if(c->socket > 0) { - closesocket(c->socket); + if(c->status.tarpit) { + tarpit(c->socket); + } else { + closesocket(c->socket); + } } free(c->name);