]> git.meshlink.io Git - meshlink/commitdiff
Account for SPTPS overhead.
authorGuus Sliepen <guus@meshlink.io>
Sun, 26 Sep 2021 18:20:06 +0000 (20:20 +0200)
committerGuus Sliepen <guus@meshlink.io>
Fri, 8 Oct 2021 18:57:24 +0000 (20:57 +0200)
src/pmtu.c

index 5f771cfc7bdb3ef768c536e595381e7f01a214c2..7d238e2515efc41ae4bd69132655ca35f75a13b5 100644 (file)
@@ -123,7 +123,7 @@ static void send_udp_probe_reply(meshlink_handle_t *mesh, node_t *n, vpn_packet_
        bool udp_confirmed = n->status.udp_confirmed;
        n->status.udp_confirmed = true;
        logger(mesh, MESHLINK_DEBUG, "Sending UDP reply length %d to %s", packet->len, n->name);
-       n->out_meta += packet->len;
+       n->out_meta += packet->len + SPTPS_DATAGRAM_OVERHEAD;
        send_udppacket(mesh, n, packet);
        n->status.udp_confirmed = udp_confirmed;
 }
@@ -134,7 +134,7 @@ void udp_probe_h(meshlink_handle_t *mesh, node_t *n, vpn_packet_t *packet, uint1
                return;
        }
 
-       n->in_meta += packet->len;
+       n->in_meta += packet->len + SPTPS_DATAGRAM_OVERHEAD;
 
        if(!packet->data[0]) {
                /* It's a probe request, send back a reply */
@@ -215,7 +215,7 @@ static void send_udp_probe_packet(meshlink_handle_t *mesh, node_t *n, int len) {
 
        logger(mesh, MESHLINK_DEBUG, "Sending UDP probe length %d to %s", len, n->name);
 
-       n->out_meta += packet.len;
+       n->out_meta += packet.len + SPTPS_DATAGRAM_OVERHEAD;
        send_udppacket(mesh, n, &packet);
 }