X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=src%2Fnet_setup.c;fp=src%2Fnet_setup.c;h=a7a538f01c75d1b4ed66fa77114391bbce123ce1;hb=afea9096fa708b2a2e6e24c308c0f1a80eefa5cc;hp=6168c4ca340dfc92f9551c2c17f78eb624600758;hpb=0fdc99b6a501992b8c1dea2d1a909363b5564d0d;p=meshlink diff --git a/src/net_setup.c b/src/net_setup.c index 6168c4ca..a7a538f0 100644 --- a/src/net_setup.c +++ b/src/net_setup.c @@ -218,11 +218,26 @@ bool node_read_from_config(meshlink_handle_t *mesh, node_t *n, const config_t *c return packmsg_done(&in); } -bool node_write_config(meshlink_handle_t *mesh, node_t *n) { +bool node_write_config(meshlink_handle_t *mesh, node_t *n, bool new_key) { if(!mesh->confbase) { return true; } + switch(mesh->storage_policy) { + case MESHLINK_STORAGE_KEYS_ONLY: + if(!new_key) { + return true; + } + + break; + + case MESHLINK_STORAGE_DISABLED: + return true; + + default: + break; + } + uint8_t buf[4096]; packmsg_output_t out = {buf, sizeof(buf)}; @@ -271,6 +286,7 @@ bool node_write_config(meshlink_handle_t *mesh, node_t *n) { return false; } + n->status.dirty = false; return true; }