X-Git-Url: https://tinc-vpn.org/git/browse?a=blobdiff_plain;f=src%2Fcontrol.c;h=c166943ba59a607aa0ba8a85198ef68303167bc6;hb=d917c8cb6b69475d568ccbe82389b9f2b3eb5e80;hp=956d6ee10bd066174c4ef406ec8d71020b31de9d;hpb=19be9cf7150858311f7898fa3fb525d692d02f64;p=tinc diff --git a/src/control.c b/src/control.c index 956d6ee1..c166943b 100644 --- a/src/control.c +++ b/src/control.c @@ -29,7 +29,6 @@ #include "netutl.h" #include "protocol.h" #include "route.h" -#include "splay_tree.h" #include "utils.h" #include "xalloc.h" @@ -64,7 +63,7 @@ bool control_h(connection_t *c, const char *request) { case REQ_DUMP_NODES: return dump_nodes(c); - + case REQ_DUMP_EDGES: return dump_edges(c); @@ -99,16 +98,12 @@ bool control_h(connection_t *c, const char *request) { case REQ_DISCONNECT: { char name[MAX_STRING_SIZE]; - connection_t *other; - splay_node_t *node, *next; bool found = false; if(sscanf(request, "%*d %*d " MAX_STRING, name) != 1) return control_return(c, REQ_DISCONNECT, -1); - for(node = connection_tree->head; node; node = next) { - next = node->next; - other = node->data; + for list_each(connection_t, other, connection_list) { if(strcmp(other->name, name)) continue; terminate_connection(other, other->status.active);