X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=src%2Fprotocol_auth.c;h=4165bb1b987cfbfa4dae0d5362a8137ef7eeaece;hb=0e1a437e75080dec585b502ee0031fdb8c1d2468;hp=201cac9fe000eef05b17561fd4223ec31805e60b;hpb=8d4b96efb7955eaa96174af4804597f92e124041;p=meshlink diff --git a/src/protocol_auth.c b/src/protocol_auth.c index 201cac9f..4165bb1b 100644 --- a/src/protocol_auth.c +++ b/src/protocol_auth.c @@ -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 */ @@ -370,6 +371,10 @@ bool ack_h(meshlink_handle_t *mesh, connection_t *c, const char *request) { logger(mesh, MESHLINK_INFO, "Connection with %s activated", c->name); + if(mesh->meta_status_cb) { + mesh->meta_status_cb(mesh, (meshlink_node_t *)n, true); + } + /* Send him everything we know */ send_everything(mesh, c); @@ -385,6 +390,7 @@ bool ack_h(meshlink_handle_t *mesh, connection_t *c, const char *request) { c->edge->weight = mesh->dev_class_traits[devclass].edge_weight; c->edge->connection = c; + node_add_recent_address(mesh, n, &c->address); edge_add(mesh, c->edge); /* Notify everyone of the new edge */ @@ -395,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; }