X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=src%2Fgraph.c;h=43e526b044ce781976d403f4b50fee581a472d11;hb=1e08f518b26db292ad81ce44fc0df06f4df3a869;hp=233cf5442a4e000e612a8a64f6b384de65ffeaf4;hpb=98376916eae96a058d4291187d3960eeea218fee;p=meshlink diff --git a/src/graph.c b/src/graph.c index 233cf544..43e526b0 100644 --- a/src/graph.c +++ b/src/graph.c @@ -48,6 +48,7 @@ #include "graph.h" #include "list.h" #include "logger.h" +#include "meshlink_internal.h" #include "netutl.h" #include "node.h" #include "protocol.h" @@ -125,15 +126,15 @@ static void sssp_bfs(void) { n->distance = -1; } - /* Begin with myself */ + /* Begin with mesh->self */ - myself->status.visited = true; - myself->status.indirect = false; - myself->nexthop = myself; - myself->prevedge = NULL; - myself->via = myself; - myself->distance = 0; - list_insert_head(todo_list, myself); + mesh->self->status.visited = true; + mesh->self->status.indirect = false; + mesh->self->nexthop = mesh->self; + mesh->self->prevedge = NULL; + mesh->self->via = mesh->self; + mesh->self->distance = 0; + list_insert_head(todo_list, mesh->self); /* Loop while todo_list is filled */ @@ -173,7 +174,7 @@ static void sssp_bfs(void) { e->to->status.visited = true; e->to->status.indirect = indirect; - e->to->nexthop = (n->nexthop == myself) ? e->to : n->nexthop; + e->to->nexthop = (n->nexthop == mesh->self) ? e->to : n->nexthop; e->to->prevedge = e; e->to->via = indirect ? n->via : e->to; e->to->options = e->options;