X-Git-Url: https://tinc-vpn.org/git/browse?p=tinc;a=blobdiff_plain;f=src%2Fgraph.c;h=49161c1683754a517625698055b6bd7783ff7674;hp=8f601c2170f7db497df4e375907f058b9c41ea25;hb=abb24e9d71b3edb9cacf4c04361cc0dfd4e6a061;hpb=bd451cfe1512fa69eac35a60dbe6df17bfc39154 diff --git a/src/graph.c b/src/graph.c index 8f601c21..49161c16 100644 --- a/src/graph.c +++ b/src/graph.c @@ -238,10 +238,11 @@ static void check_reachability(void) { n->status.udp_confirmed = false; n->maxmtu = MTU; + n->maxrecentlen = 0; n->minmtu = 0; n->mtuprobes = 0; - timeout_del(&n->mtutimeout); + timeout_del(&n->udp_ping_timeout); char *name; char *address; @@ -276,12 +277,9 @@ static void check_reachability(void) { memset(&n->status, 0, sizeof n->status); n->options = 0; } else if(n->connection) { - if(n->status.sptps) { - if(n->connection->outgoing) - send_req_key(n); - } else { + // Speed up UDP probing by sending our key. + if(!n->status.sptps) send_ans_key(n); - } } } @@ -292,7 +290,7 @@ static void check_reachability(void) { if (device_standby) { if (reachable_count == 0 && became_unreachable_count > 0) device_disable(); - else if (reachable_count == became_reachable_count) + else if (reachable_count > 0 && reachable_count == became_reachable_count) device_enable(); } }