From: Guus Sliepen Date: Sun, 11 Jan 2015 15:14:05 +0000 (+0100) Subject: Send the size of the largest recently received packets in type 2 probe replies. X-Git-Tag: release-1.1pre12~209 X-Git-Url: https://tinc-vpn.org/git/browse?a=commitdiff_plain;h=7b76b7ac35b49b8a94ad91c432886a0a54e144d1;p=tinc Send the size of the largest recently received packets in type 2 probe replies. --- diff --git a/src/net_packet.c b/src/net_packet.c index 52c46e14..16f8e5ed 100644 --- a/src/net_packet.c +++ b/src/net_packet.c @@ -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 {