]> git.meshlink.io Git - meshlink-tiny/blobdiff - src/protocol_key.c
Remove support for request forwarding.
[meshlink-tiny] / src / protocol_key.c
index e89f8ecec4eab958c7948c28ce7361987b4395a1..c2d6036b5853da0e978fe0b463626831e26c0cd2 100644 (file)
@@ -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? */