From eeb8f3502fdf25704ce2d234732509cad32e8bff Mon Sep 17 00:00:00 2001 From: Guus Sliepen Date: Mon, 3 Feb 2020 17:03:07 +0100 Subject: [PATCH] Prevent meshlink_errno from being set incorrectly by meshlink_invite() We called a public API function inside meshlink_invite() to check that we don't try to invite a node that's already known. That causes it to set meshlink_errno to MESHLINK_ENOENT. Fix this by calling lookup_node() instead. --- src/meshlink.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/meshlink.c b/src/meshlink.c index 11e45503..0fbcf153 100644 --- a/src/meshlink.c +++ b/src/meshlink.c @@ -2428,7 +2428,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); -- 2.39.2