X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=src%2Fmeshlink.c;h=d1987ab8c1ebfe36deb62cec72c043e814f6ef48;hb=8c5cd31cecf9d91d362199dc89effcfe59072e13;hp=0bec2f8aaf831c2cfd663f36fb7c0f97a7155633;hpb=c1aaccb26739c0c513c9443dce57560349141687;p=meshlink diff --git a/src/meshlink.c b/src/meshlink.c index 0bec2f8a..d1987ab8 100644 --- a/src/meshlink.c +++ b/src/meshlink.c @@ -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; @@ -720,7 +724,7 @@ static bool invitation_receive(void *handle, uint8_t type, const void *msg, uint return finalize_join(mesh, msg, len); case 1: - logger(mesh, MESHLINK_DEBUG, "Invitation succesfully accepted.\n"); + logger(mesh, MESHLINK_DEBUG, "Invitation successfully accepted.\n"); shutdown(mesh->sock, SHUT_RDWR); mesh->success = true; break; @@ -2428,7 +2432,7 @@ char *meshlink_invite_ex(meshlink_handle_t *mesh, meshlink_submesh_t *submesh, c } // Ensure no other nodes know about this name - if(meshlink_get_node(mesh, name)) { + if(lookup_node(mesh, name)) { logger(mesh, MESHLINK_ERROR, "A node with name %s is already known!\n", name); meshlink_errno = MESHLINK_EEXIST; pthread_mutex_unlock(&mesh->mutex); @@ -2454,7 +2458,7 @@ char *meshlink_invite_ex(meshlink_handle_t *mesh, meshlink_submesh_t *submesh, c // If we changed our own host config file, write it out now if(mesh->self->status.dirty) { if(!node_write_config(mesh, mesh->self)) { - logger(mesh, MESHLINK_ERROR, "Could not write our own host conifg file!\n"); + logger(mesh, MESHLINK_ERROR, "Could not write our own host config file!\n"); pthread_mutex_unlock(&mesh->mutex); return NULL; }