X-Git-Url: https://tinc-vpn.org/git/browse?p=tinc;a=blobdiff_plain;f=src%2Fconnection.c;h=d39f43ff71ee4b163e2e3a6622065a40340512d5;hp=cbe704b537e24c246df59a5af43bd3f3e05456a1;hb=d917c8cb6b69475d568ccbe82389b9f2b3eb5e80;hpb=0b8b23e0dd7219344543f135ca0aeba8a4a42d48 diff --git a/src/connection.c b/src/connection.c index cbe704b5..d39f43ff 100644 --- a/src/connection.c +++ b/src/connection.c @@ -31,7 +31,7 @@ #include "utils.h" #include "xalloc.h" -list_t *connection_list; /* Meta connections */ +list_t *connection_list; connection_t *everyone; void init_connections(void) { @@ -67,7 +67,7 @@ void free_connection(connection_t *c) { buffer_clear(&c->inbuf); buffer_clear(&c->outbuf); - + if(event_initialized(&c->inevent)) event_del(&c->inevent); @@ -91,12 +91,7 @@ void connection_add(connection_t *c) { } void connection_del(connection_t *c) { - for list_each(connection_t, c, connection_list) { - if(node->data == c) { - list_delete_node(connection_list, node); - return; - } - } + list_delete(connection_list, c); } bool dump_connections(connection_t *cdump) {