- syslog(LOG_ERR, _("Implementation of Kruskal's algorithm is screwed: %d nodes, found %d safe edges"), nodes, safe_edges);
+ for(from = todo_tree->head; from; from = next)
+ {
+ next = from->next;
+ n = (node_t *)from->data;
+
+ for(to = n->edge_tree->head; to; to = to->next)
+ {
+ e = (edge_t *)to->data;
+
+ if(e->from == n)
+ check = e->to;
+ else
+ check = e->from;
+
+ if(!check->status.visited)
+ {
+ check->status.visited = 1;
+ check->nexthop = (n->nexthop == myself) ? check : n->nexthop;
+ check->via = check; /* FIXME: only if !(e->options & INDIRECT), otherwise use n->via */
+ node = avl_alloc_node();
+ node->data = check;
+ avl_insert_before(todo_tree, from, node);
+ }
+ }
+
+ avl_delete_node(todo_tree, from);
+ }