X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;ds=sidebyside;f=src%2Fgraph.c;h=56ef11db382deb39f5268cb0e8a34fcfc198f4a1;hb=8ccad64979db3f96e935c6fbfaf9733dafe2ee66;hp=754626edd8a117fa15ddcdf9845a18c1aa43ae16;hpb=8d4b96efb7955eaa96174af4804597f92e124041;p=meshlink diff --git a/src/graph.c b/src/graph.c index 754626ed..56ef11db 100644 --- a/src/graph.c +++ b/src/graph.c @@ -193,10 +193,13 @@ static void check_reachability(meshlink_handle_t *mesh) { /* TODO: only clear status.validkey if node is unreachable? */ - n->status.validkey = false; - sptps_stop(&n->sptps); - n->status.waitingforkey = false; - n->last_req_key = -3600; + if(!n->status.reachable) { + logger(mesh, MESHLINK_DEBUG, "Resetting validkey/waitingforkey for %s, reachable %d", n->name, n->status.reachable); + n->status.validkey = false; + sptps_stop(&n->sptps); + n->status.waitingforkey = false; + n->last_req_key = -3600; + } n->status.udp_confirmed = false; n->maxmtu = MTU; @@ -212,10 +215,6 @@ static void check_reachability(meshlink_handle_t *mesh) { if(!n->status.reachable) { update_node_udp(mesh, n, NULL); n->status.broadcast = false; - } else if(n->connection) { - if(n->connection->status.initiator) { - send_req_key(mesh, n); - } } if(n->utcp) {