projects
/
tinc
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add sanity checks when generating new RSA keys.
[tinc]
/
src
/
graph.c
diff --git
a/src/graph.c
b/src/graph.c
index
396e35a
..
8f20ec7
100644
(file)
--- a/
src/graph.c
+++ b/
src/graph.c
@@
-176,9
+176,13
@@
static void sssp_bfs(void) {
&& (e->to->distance != n->distance + 1 || e->weight >= e->to->prevedge->weight))
continue;
&& (e->to->distance != n->distance + 1 || e->weight >= e->to->prevedge->weight))
continue;
+ // Only update nexthop if it doesn't increase the path length
+
+ if(!e->to->status.visited || (e->to->distance == n->distance + 1 && e->weight >= e->to->prevedge->weight))
+ e->to->nexthop = (n->nexthop == myself) ? e->to : n->nexthop;
+
e->to->status.visited = true;
e->to->status.indirect = indirect;
e->to->status.visited = true;
e->to->status.indirect = indirect;
- e->to->nexthop = (n->nexthop == myself) ? e->to : n->nexthop;
e->to->prevedge = e;
e->to->via = indirect ? n->via : e->to;
e->to->options = e->options;
e->to->prevedge = e;
e->to->via = indirect ? n->via : e->to;
e->to->options = e->options;