From bfbbc484bef5a4c76656fdfbb2336f1d10510988 Mon Sep 17 00:00:00 2001 From: Guus Sliepen Date: Mon, 27 Apr 2020 22:48:45 +0200 Subject: [PATCH] Avoid sending a large probe immediately after fixing the PMTU. --- src/pmtu.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/pmtu.c b/src/pmtu.c index 770f1828..84fd23af 100644 --- a/src/pmtu.c +++ b/src/pmtu.c @@ -176,12 +176,12 @@ void udp_probe_h(meshlink_handle_t *mesh, node_t *n, vpn_packet_t *packet, uint1 /* If applicable, raise the minimum supported PMTU */ - try_fix_mtu(mesh, n); - if(n->minmtu < len) { n->minmtu = len; update_node_pmtu(mesh, n); } + + try_fix_mtu(mesh, n); } static void send_udp_probe_packet(meshlink_handle_t *mesh, node_t *n, int len) { @@ -336,8 +336,6 @@ static void try_pmtu(meshlink_handle_t *mesh, node_t *n) { n->last_mtu_probe_sent = mesh->loop.now; - try_fix_mtu(mesh, n); - if(n->mtuprobes < -3) { /* We lost three PMTU probes, restart discovery */ logger(mesh, MESHLINK_INFO, "Decrease in PMTU to %s detected, restarting PMTU discovery", n->name); @@ -377,6 +375,8 @@ static void try_pmtu(meshlink_handle_t *mesh, node_t *n) { send_udp_probe_packet(mesh, n, len); n->mtuprobes++; } + + try_fix_mtu(mesh, n); } /* Keep the connection to the given node alive. -- 2.39.5