]> git.meshlink.io Git - meshlink/blobdiff - src/protocol_auth.c
Always let the initiator send a REQ_KEY once a connection is activated.
[meshlink] / src / protocol_auth.c
index 3720e14abc64c0bf9eeb7cf71fcb927feb55f691..4165bb1b987cfbfa4dae0d5362a8137ef7eeaece 100644 (file)
@@ -360,6 +360,7 @@ bool ack_h(meshlink_handle_t *mesh, connection_t *c, const char *request) {
        n->last_successfull_connection = mesh->loop.now.tv_sec;
 
        n->connection = c;
+       n->nexthop = n;
        c->node = n;
 
        /* Activate this connection */
@@ -400,5 +401,11 @@ bool ack_h(meshlink_handle_t *mesh, connection_t *c, const char *request) {
 
        graph(mesh);
 
+       /* Request a session key to jump start UDP traffic */
+
+       if(c->status.initiator) {
+               send_req_key(mesh, n);
+       }
+
        return true;
 }