From: Guus Sliepen Date: Sat, 18 Jul 2020 12:23:56 +0000 (+0200) Subject: Send a PING packet on a meta-connection if a UDP ping failed. X-Git-Url: http://git.meshlink.io/?p=meshlink;a=commitdiff_plain;h=0669c133ef0150e9772711588651c1c4d8e45267 Send a PING packet on a meta-connection if a UDP ping failed. If we lost a UDP ping packet, it might mean the node is down. We need to confirm that with a PING on the meta-connection. --- diff --git a/src/pmtu.c b/src/pmtu.c index 4073825c..d91919ee 100644 --- a/src/pmtu.c +++ b/src/pmtu.c @@ -93,6 +93,13 @@ static void udp_probe_timeout_handler(event_loop_t *loop, void *data) { n->mtuprobes = 0; n->minmtu = 0; n->maxmtu = MTU; + + // If we also have a meta-connection to this node, send a PING on it as well + connection_t *c = n->connection; + + if(c && !c->status.pinged) { + send_ping(mesh, c); + } } static void send_udp_probe_reply(meshlink_handle_t *mesh, node_t *n, vpn_packet_t *packet, uint16_t len) {