]> git.meshlink.io Git - meshlink/commitdiff
Avoid sending a large probe immediately after fixing the PMTU.
authorGuus Sliepen <guus@meshlink.io>
Mon, 27 Apr 2020 20:48:45 +0000 (22:48 +0200)
committerGuus Sliepen <guus@meshlink.io>
Fri, 8 Oct 2021 18:57:24 +0000 (20:57 +0200)
src/pmtu.c

index 770f18280759c1ae8aa352cd10c52477384e5152..84fd23af8c4290b0a20f9c094852b766e359c62d 100644 (file)
@@ -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.