Before we started doing PMTU probes after a retransmit event, but with
the new UDP probing we need to restart the UDP probes instead, as they
will be able to detect failing UDP communication much faster.
n->status.udp_confirmed = false;
n->maxmtu = MTU;
n->minmtu = 0;
+ n->udpprobes = 0;
n->mtuprobes = 0;
}
n->status.udp_confirmed = false;
n->maxmtu = MTU;
n->minmtu = 0;
+ n->udpprobes = 0;
n->mtuprobes = 0;
timeout_del(&mesh->loop, &n->udp_ping_timeout);
#include "node.h"
#include "submesh.h"
#include "packmsg.h"
+#include "pmtu.h"
#include "prf.h"
#include "protocol.h"
#include "route.h"
n->mtu = 0;
n->minmtu = 0;
n->maxmtu = MTU;
+ n->udpprobes = 0;
n->mtuprobes = 0;
n->status.udp_confirmed = false;
node_t *n = utcp_connection->utcp->priv;
meshlink_handle_t *mesh = n->mesh;
- if(n->mtuprobes == -1 && n->udp_ping_timeout.cb) {
- timeout_set(&mesh->loop, &n->udp_ping_timeout, &(struct timespec) {
- 0, 0
- });
+ if(!n->udpprobes) {
+ timespec_clear(&n->last_udp_probe_sent);
+ keepalive(mesh, n, false);
}
}
if(elapsed.tv_sec >= interval) {
n->last_udp_probe_sent = mesh->loop.now;
send_udp_probe_packet(mesh, n, MIN_PROBE_SIZE);
- n->udpprobes--;
+
+ if(n->status.udp_confirmed) {
+ n->udpprobes--;
+ }
if(!n->status.udp_confirmed && n->prevedge) {
n->status.broadcast = true;