Send the size of the largest recently received packets in type 2 probe replies.
authorGuus Sliepen <guus@tinc-vpn.org>
Sun, 11 Jan 2015 15:14:05 +0000 (16:14 +0100)
committerGuus Sliepen <guus@tinc-vpn.org>
Sun, 11 Jan 2015 15:14:05 +0000 (16:14 +0100)
src/net_packet.c

index 52c46e1..16f8e5e 100644 (file)
@@ -114,7 +114,8 @@ static void send_udp_probe_reply(node_t *n, vpn_packet_t *packet, length_t len)
        if ((n->options >> 24) >= 3) {
                uint8_t *data = DATA(packet);
                *data++ = 2;
-               uint16_t len16 = htons(len);
+               uint16_t len16 = htons(MAX(len, n->maxrecentlen));
+               n->maxrecentlen = 0;
                memcpy(data, &len16, 2);
                packet->len = MIN_PROBE_SIZE;
        } else {