]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: quic: fix CRYPTO payload size calcul for encoding
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Tue, 11 Feb 2025 13:35:52 +0000 (14:35 +0100)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Wed, 12 Feb 2025 10:51:09 +0000 (11:51 +0100)
commite6a223542ae87880b3e8261daffbe362730f9e55
treeb324c15260fe5a5e194486aee9fcc788fde88fc7
parent63747452a39cff72a6bc7610da079afe01fb6dcc
BUG/MINOR: quic: fix CRYPTO payload size calcul for encoding

Function max_stream_data_size() is used to determine the payload length
of a CRYPTO frame. It takes into account that the CRYPTO length field is
a variable length integer.

Implemented calcul was incorrect as it reserved too much space as a
frame header. This error is mostly due because max_stream_data_size()
reuses max_available_room() which also reserve space for a variable
length integer. This results in CRYPTO frames shorter of 1 to 2 bytes
than the maximum achievable value, which produces in the end datagram
shorter than the MTU.

Fix max_stream_data_size() implementation. It is now merely a wrapper on
max_available_room(). This ensures that CRYPTO frame encoding is now
properly optimized to use the MTU available.

This should be backported up to 2.6.
src/quic_tx.c