X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=src%2Fprotocol_key.c;h=c2d6036b5853da0e978fe0b463626831e26c0cd2;hb=9759acaa786734e050d31bd6f8c150b8a80a597d;hp=e89f8ecec4eab958c7948c28ce7361987b4395a1;hpb=664466227602b6aabd4f601cf57183bbfa45bc08;p=meshlink-tiny diff --git a/src/protocol_key.c b/src/protocol_key.c index e89f8ec..c2d6036 100644 --- a/src/protocol_key.c +++ b/src/protocol_key.c @@ -45,10 +45,6 @@ bool key_changed_h(meshlink_handle_t *mesh, connection_t *c, const char *request return false; } - if(seen_request(mesh, request)) { - return true; - } - n = lookup_node(mesh, name); if(!n) { @@ -56,10 +52,6 @@ bool key_changed_h(meshlink_handle_t *mesh, connection_t *c, const char *request return true; } - /* Tell the others */ - - forward_request(mesh, c, request); - return true; } @@ -394,24 +386,9 @@ bool ans_key_h(meshlink_handle_t *mesh, connection_t *c, const char *request) { /* Forward it if necessary */ if(to != mesh->self) { - if(!to->status.reachable) { - logger(mesh, MESHLINK_WARNING, "Got %s from %s destination %s which is not reachable", - "ANS_KEY", c->name, to_name); - return true; - } - - if(from == to) { - logger(mesh, MESHLINK_WARNING, "Got %s from %s from %s to %s", - "ANS_KEY", c->name, from_name, to_name); - return true; - } - - if(!to->nexthop || !to->nexthop->connection) { - logger(mesh, MESHLINK_WARNING, "Cannot forward ANS_KEY to %s via %s", to->name, to->nexthop ? to->nexthop->name : to->name); - return false; - } - - return send_request(mesh, to->nexthop->connection, "%s", request); + logger(mesh, MESHLINK_WARNING, "Got %s from %s destination %s which is not for us", + "ANS_KEY", c->name, to_name); + return true; } /* Is this an ANS_KEY informing us of our own reflexive UDP address? */