]> git.meshlink.io Git - meshlink/commitdiff
Clear reachability times in host config files received during a join.
authorGuus Sliepen <guus@meshlink.io>
Mon, 3 Feb 2020 16:43:50 +0000 (17:43 +0100)
committerGuus Sliepen <guus@meshlink.io>
Mon, 3 Feb 2020 16:43:50 +0000 (17:43 +0100)
When a node joins an existing mesh, it gets passed one or more host config
files from the inviter. However, these might contain non-zero reachability
times, but the invitee has never seen those nodes, so clear them before
storing the host config files.

src/meshlink.c

index 0fbcf1535379810fd2295d4d28287a87b1beb774..d1987ab8c1ebfe36deb62cec72c043e814f6ef48 100644 (file)
@@ -668,6 +668,10 @@ static bool finalize_join(meshlink_handle_t *mesh, const void *buf, uint16_t len
                        }
                }
 
+               /* 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;