]> git.meshlink.io Git - meshlink/blobdiff - src/protocol_auth.c
Move several variables to mesh.
[meshlink] / src / protocol_auth.c
index 14686ac903b1c5d9b1c0e9af186c9f5aa34c1035..8b419bad8863c3e18bcf5a56afc2acb05a2a4f17 100644 (file)
@@ -148,7 +148,7 @@ static bool finalize_invitation(connection_t *c, const char *data, uint16_t len)
 
        // Create a new host config file
        char filename[PATH_MAX];
-       snprintf(filename, sizeof filename, "%s" SLASH "hosts" SLASH "%s", confbase, c->name);
+       snprintf(filename, sizeof filename, "%s" SLASH "hosts" SLASH "%s", mesh->confbase, c->name);
        if(!access(filename, F_OK)) {
                logger(DEBUG_ALWAYS, LOG_ERR, "Host config file for %s (%s) already exists!\n", c->name, c->hostname);
                return false;
@@ -195,8 +195,8 @@ static bool receive_invitation_sptps(void *handle, uint8_t type, const char *dat
        free(fingerprint);
 
        char filename[PATH_MAX], usedname[PATH_MAX];
-       snprintf(filename, sizeof filename, "%s" SLASH "invitations" SLASH "%s", confbase, cookie);
-       snprintf(usedname, sizeof usedname, "%s" SLASH "invitations" SLASH "%s.used", confbase, cookie);
+       snprintf(filename, sizeof filename, "%s" SLASH "invitations" SLASH "%s", mesh->confbase, cookie);
+       snprintf(usedname, sizeof usedname, "%s" SLASH "invitations" SLASH "%s.used", mesh->confbase, cookie);
 
        // Atomically rename the invitation file
        if(rename(filename, usedname)) {
@@ -394,7 +394,7 @@ static void send_everything(connection_t *c) {
                send_tcppacket(c, &zeropkt.pkt);
        }
 
-       for splay_each(node_t, n, node_tree) {
+       for splay_each(node_t, n, mesh->nodes) {
                for splay_each(edge_t, e, n->edge_tree)
                        send_add_edge(c, e);
        }