projects
/
tinc
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add the AutoConnect option.
[tinc]
/
src
/
control.c
diff --git
a/src/control.c
b/src/control.c
index
956d6ee
..
c166943
100644
(file)
--- a/
src/control.c
+++ b/
src/control.c
@@
-29,7
+29,6
@@
#include "netutl.h"
#include "protocol.h"
#include "route.h"
#include "netutl.h"
#include "protocol.h"
#include "route.h"
-#include "splay_tree.h"
#include "utils.h"
#include "xalloc.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_NODES:
return dump_nodes(c);
-
+
case REQ_DUMP_EDGES:
return dump_edges(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];
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);
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);
if(strcmp(other->name, name))
continue;
terminate_connection(other, other->status.active);