X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=src%2Fgraph.c;h=d40087d8dc1c65f680c9f55b403f52c3acfc110f;hb=a5750efefc491d77ff6a45f0ebc21976831eebfe;hp=9955ea41644721a208041de60860329158998e04;hpb=8d4ac42ceb67a93fc1e5c0d045819597c5da47d0;p=meshlink diff --git a/src/graph.c b/src/graph.c index 9955ea41..d40087d8 100644 --- a/src/graph.c +++ b/src/graph.c @@ -144,6 +144,23 @@ static void check_reachability(meshlink_handle_t *mesh) { if(n->utcp) { utcp_abort_all_connections(n->utcp); } + + if(n->status.visited == n->status.reachable) { + /* This session replaces the previous one without changing reachability status. + * We still need to reset the UDP SPTPS state. + */ + n->status.validkey = false; + sptps_stop(&n->sptps); + n->status.waitingforkey = false; + n->last_req_key = 0; + + n->status.udp_confirmed = false; + n->maxmtu = MTU; + n->minmtu = 0; + n->mtuprobes = 0; + + timeout_del(&mesh->loop, &n->mtutimeout); + } } if(n->status.visited != n->status.reachable) {