From: Guus Sliepen Date: Fri, 6 Dec 2019 22:01:46 +0000 (+0100) Subject: Remember the address used by an invitee. X-Git-Url: https://git.meshlink.io/?a=commitdiff_plain;h=5f79c2c0882e03648acb9c4a2f6780a7513c61aa;p=meshlink Remember the address used by an invitee. When a new node uses an invitation succesfully, store the address it used to connect. --- diff --git a/src/protocol_auth.c b/src/protocol_auth.c index e80af7d9..3676e9cb 100644 --- a/src/protocol_auth.c +++ b/src/protocol_auth.c @@ -165,6 +165,9 @@ static bool finalize_invitation(meshlink_handle_t *mesh, connection_t *c, const n->ecdsa = ecdsa_set_public_key(data); n->submesh = c->submesh; + // Remember its current address + node_add_recent_address(mesh, n, &c->address); + if(!node_write_config(mesh, n) || !config_sync(mesh, "current")) { logger(mesh, MESHLINK_ERROR, "Error writing configuration file for invited node %s!\n", c->name); free_node(n);