projects
/
tinc
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
47d916e
)
When building the minimum spanning tree, make sure we start from a reachable node.
author
Guus Sliepen
<guus@tinc-vpn.org>
Tue, 12 Dec 2006 14:49:09 +0000
(14:49 +0000)
committer
Guus Sliepen
<guus@tinc-vpn.org>
Tue, 12 Dec 2006 14:49:09 +0000
(14:49 +0000)
src/graph.c
patch
|
blob
|
history
diff --git
a/src/graph.c
b/src/graph.c
index
eadb36a
..
9dd3fa5
100644
(file)
--- a/
src/graph.c
+++ b/
src/graph.c
@@
-101,7
+101,13
@@
void mst_kruskal(void)
/* Starting point */
- ((edge_t *) edge_weight_tree->head->data)->from->status.visited = true;
+ for(node = edge_weight_tree->head; node; node = next) {
+ e = node->data;
+ if(e->from->status.reachable) {
+ e->from->status.visited = true;
+ break;
+ }
+ }
/* Add safe edges */
@@
-307,8
+313,8
@@
void sssp_bfs(void)
void graph(void)
{
- mst_kruskal();
sssp_bfs();
+ mst_kruskal();
graph_changed = true;
}