X-Git-Url: http://git.meshlink.io/?p=meshlink;a=blobdiff_plain;f=src%2Fgraph.c;h=d70279c2e85b99f6a9f28a6ef7ed142dbfe68f7a;hp=18376c14956a619a9e99441365fd44c42a7cfa18;hb=df4ba45db481a9cda90e487dc154995f590d8b3e;hpb=be83b0af60449c7b35d17d97f2e6dc12f611e831 diff --git a/src/graph.c b/src/graph.c index 18376c14..d70279c2 100644 --- a/src/graph.c +++ b/src/graph.c @@ -175,7 +175,12 @@ static void check_reachability(meshlink_handle_t *mesh) { if(n->status.reachable) { logger(mesh, MESHLINK_DEBUG, "Node %s became reachable", n->name); + bool first_time_reachable = !n->last_reachable; n->last_reachable = mesh->loop.now.tv_sec; + + if(first_time_reachable) { + node_write_config(mesh, n); + } } else { logger(mesh, MESHLINK_DEBUG, "Node %s became unreachable", n->name); n->last_unreachable = mesh->loop.now.tv_sec;