From: Guus Sliepen Date: Fri, 24 Jan 2020 20:08:01 +0000 (+0100) Subject: Sync host config file immediately after initial connect. X-Git-Url: https://git.meshlink.io/?a=commitdiff_plain;h=df4ba45db481a9cda90e487dc154995f590d8b3e;p=meshlink Sync host config file immediately after initial connect. --- 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;