X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;ds=sidebyside;f=src%2Fprotocol_key.c;h=6a2946eb8d6ca22be39d3cbcea42fcb0a9c181d3;hb=eba5b30f09f91d95c56efb8f1d8613152c176856;hp=dbe3d917b779b87126bed3ca23ffcd5324c781a3;hpb=7870cb4a1882fb0e3fd4e90784f81327fc0cab08;p=meshlink diff --git a/src/protocol_key.c b/src/protocol_key.c index dbe3d917..6a2946eb 100644 --- a/src/protocol_key.c +++ b/src/protocol_key.c @@ -146,6 +146,13 @@ static bool req_key_ext_h(meshlink_handle_t *mesh, connection_t *c, const char * logger(mesh, MESHLINK_ERROR, "Got bad %s from %s: %s", "REQ_PUBKEY", from->name, "invalid pubkey"); return true; } + + logger(mesh, MESHLINK_INFO, "Learned ECDSA public key from %s", from->name); + from->status.dirty = true; + + if(!node_write_config(mesh, from, true)) { + // ignore + } } } @@ -170,6 +177,10 @@ static bool req_key_ext_h(meshlink_handle_t *mesh, connection_t *c, const char * logger(mesh, MESHLINK_INFO, "Learned ECDSA public key from %s", from->name); from->status.dirty = true; + if(!node_write_config(mesh, from, true)) { + // ignore + } + /* If we are trying to form an outgoing connection to this node, retry immediately */ for list_each(outgoing_t, outgoing, mesh->outgoings) { if(outgoing->node == from && outgoing->ev.cb) {