From df4ba45db481a9cda90e487dc154995f590d8b3e Mon Sep 17 00:00:00 2001 From: Guus Sliepen Date: Fri, 24 Jan 2020 21:08:01 +0100 Subject: [PATCH] Sync host config file immediately after initial connect. --- src/graph.c | 5 +++++ 1 file changed, 5 insertions(+) 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; -- 2.39.2