projects
/
tinc
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
994adad
)
Improve performance of edge updates.
author
Guus Sliepen
<guus@tinc-vpn.org>
Sat, 27 Feb 2016 13:18:20 +0000
(14:18 +0100)
committer
Guus Sliepen
<guus@tinc-vpn.org>
Sun, 28 Feb 2016 15:29:51 +0000
(16:29 +0100)
src/protocol_edge.c
patch
|
blob
|
history
diff --git
a/src/protocol_edge.c
b/src/protocol_edge.c
index
c000ec0
..
5553f43
100644
(file)
--- a/
src/protocol_edge.c
+++ b/
src/protocol_edge.c
@@
-142,8
+142,19
@@
bool add_edge_h(connection_t *c, const char *request) {
} else {
logger(DEBUG_PROTOCOL, LOG_WARNING, "Got %s from %s (%s) which does not match existing entry",
"ADD_EDGE", c->name, c->hostname);
} else {
logger(DEBUG_PROTOCOL, LOG_WARNING, "Got %s from %s (%s) which does not match existing entry",
"ADD_EDGE", c->name, c->hostname);
- edge_del(e);
+ e->options = options;
+ if(sockaddrcmp(&e->address, &address)) {
+ sockaddrfree(&e->address);
+ e->address = address;
+ }
+ if(e->weight != weight) {
+ avl_node_t *node = avl_unlink(edge_weight_tree, e);
+ e->weight = weight;
+ avl_insert_node(edge_weight_tree, node);
+ }
+
graph();
graph();
+ return true;
}
} else if(sockaddrcmp(&e->local_address, &local_address)) {
if(from == myself) {
}
} else if(sockaddrcmp(&e->local_address, &local_address)) {
if(from == myself) {