]> git.meshlink.io Git - meshlink/commitdiff
Remember the address used by an invitee.
authorGuus Sliepen <guus@meshlink.io>
Fri, 6 Dec 2019 22:01:46 +0000 (23:01 +0100)
committerGuus Sliepen <guus@meshlink.io>
Fri, 6 Dec 2019 22:01:46 +0000 (23:01 +0100)
When a new node uses an invitation succesfully, store the address it
used to connect.

src/protocol_auth.c

index e80af7d94a7c3f246e9267eb5fde93d6fd4b534d..3676e9cb6f47ac88ab36f3c90e9849db4aeaa4ba 100644 (file)
@@ -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);