]> git.meshlink.io Git - meshlink/commitdiff
Clear reachability times in imported host config files.
authorGuus Sliepen <guus@meshlink.io>
Tue, 4 Feb 2020 22:11:34 +0000 (23:11 +0100)
committerGuus Sliepen <guus@meshlink.io>
Tue, 4 Feb 2020 22:11:34 +0000 (23:11 +0100)
This mirrors what we do with host config files received during a join.

src/meshlink.c

index d1987ab8c1ebfe36deb62cec72c043e814f6ef48..a93bdd674ac32579adc39ddf337645599f0bd913 100644 (file)
@@ -2923,7 +2923,11 @@ bool meshlink_import(meshlink_handle_t *mesh, const char *data) {
                        break;
                }
 
-               if(!config_write(mesh, "current", n->name, &config, mesh->config_key)) {
+               /* Clear the reachability times, since we ourself have never seen these nodes yet */
+               n->last_reachable = 0;
+               n->last_unreachable = 0;
+
+               if(!node_write_config(mesh, n)) {
                        free_node(n);
                        return false;
                }