]> git.meshlink.io Git - meshlink/commitdiff
Nodes should only be in the node_udp_tree if they are reachable.
authorGuus Sliepen <guus@tinc-vpn.org>
Tue, 4 Jan 2005 22:19:56 +0000 (22:19 +0000)
committerGuus Sliepen <guus@tinc-vpn.org>
Tue, 4 Jan 2005 22:19:56 +0000 (22:19 +0000)
src/graph.c
src/node.c

index a3fe0ce552134a8fa5e9baaabd8f688b79fb3048..f6ce90dea8605f5af9995e5e73574cc67ab82987 100644 (file)
@@ -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;
index b6ba1b41bbe9e43e93c1933bc6b3f499b00e7beb..9f1a78afed4248572800b22600947ed6df8f5cc7 100644 (file)
@@ -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)