]> git.meshlink.io Git - meshlink/blobdiff - src/graph.c
Remove global variable "now".
[meshlink] / src / graph.c
index a7612ab0aa6d94c01230f7d7cc0ed2e36a29f61b..ef152a0677e2c057559cde151eed69fb1fbdd713 100644 (file)
@@ -64,7 +64,7 @@
 static void mst_kruskal(void) {
        /* Clear MST status on connections */
 
-       for list_each(connection_t, c, connection_list)
+       for list_each(connection_t, c, mesh->connections)
                c->status.mst = false;
 
        logger(DEBUG_SCARY_THINGS, LOG_DEBUG, "Running Kruskal's algorithm:");
@@ -199,7 +199,7 @@ static void check_reachability(void) {
        for splay_each(node_t, n, mesh->nodes) {
                if(n->status.visited != n->status.reachable) {
                        n->status.reachable = !n->status.reachable;
-                       n->last_state_change = now.tv_sec;
+                       n->last_state_change = mesh->loop.now.tv_sec;
 
                        if(n->status.reachable) {
                                logger(DEBUG_TRAFFIC, LOG_DEBUG, "Node %s (%s) became reachable",
@@ -221,7 +221,7 @@ static void check_reachability(void) {
                        n->minmtu = 0;
                        n->mtuprobes = 0;
 
-                       timeout_del(&n->mtutimeout);
+                       timeout_del(&mesh->loop, &n->mtutimeout);
 
                        //TODO: callback to application to inform of this node going up/down