]> git.meshlink.io Git - meshlink/blobdiff - src/meshlink.c
Don't allow meshlink_join() when the storage policy is DISABLED.
[meshlink] / src / meshlink.c
index 26bcada773151a382772e2117e05d5bb101ce67f..8b9e195fa7df2b9a96d4c949d721867d10271783 100644 (file)
@@ -1846,7 +1846,9 @@ void meshlink_stop(meshlink_handle_t *mesh) {
        if(mesh->nodes) {
                for splay_each(node_t, n, mesh->nodes) {
                        if(n->status.dirty) {
-                               n->status.dirty = !node_write_config(mesh, n, false);
+                               if(!node_write_config(mesh, n, false)) {
+                                       // ignore
+                               }
                        }
                }
        }
@@ -3023,6 +3025,11 @@ bool meshlink_join(meshlink_handle_t *mesh, const char *invitation) {
                return false;
        }
 
+       if(mesh->storage_policy == MESHLINK_STORAGE_DISABLED) {
+               meshlink_errno = MESHLINK_EINVAL;
+               return false;
+       }
+
        join_state_t state = {
                .mesh = mesh,
                .sock = -1,