From: Guus Sliepen Date: Tue, 4 Jan 2005 22:19:56 +0000 (+0000) Subject: Nodes should only be in the node_udp_tree if they are reachable. X-Git-Tag: release-1.0.4~8 X-Git-Url: https://tinc-vpn.org/git/browse?a=commitdiff_plain;h=39fe3b445c2f20b325ee492dd1845877777b25c8;p=tinc Nodes should only be in the node_udp_tree if they are reachable. --- diff --git a/src/graph.c b/src/graph.c index a3fe0ce5..f6ce90de 100644 --- a/src/graph.c +++ b/src/graph.c @@ -258,9 +258,11 @@ void sssp_bfs(void) if(n->status.reachable) { ifdebug(TRAFFIC) logger(LOG_DEBUG, _("Node %s (%s) became reachable"), n->name, n->hostname); + avl_insert(node_udp_tree, n); } else { ifdebug(TRAFFIC) logger(LOG_DEBUG, _("Node %s (%s) became unreachable"), n->name, n->hostname); + avl_delete(node_udp_tree, n); } n->status.validkey = false; diff --git a/src/node.c b/src/node.c index b6ba1b41..9f1a78af 100644 --- a/src/node.c +++ b/src/node.c @@ -123,7 +123,6 @@ void node_add(node_t *n) cp(); avl_insert(node_tree, n); - avl_insert(node_udp_tree, n); } void node_del(node_t *n) @@ -147,7 +146,6 @@ void node_del(node_t *n) } avl_delete(node_tree, n); - avl_delete(node_udp_tree, n); } node_t *lookup_node(char *name)