]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: quic: fix malformed probing packet building
authorFrederic Lecaille <flecaille@haproxy.com>
Mon, 4 Nov 2024 17:50:10 +0000 (18:50 +0100)
committerFrederic Lecaille <flecaille@haproxy.com>
Tue, 5 Nov 2024 19:17:35 +0000 (20:17 +0100)
commit217e467e89d15f3c22e11fe144458afbf718c8a8
tree5488deb46d16901535253cfdccc0ba112607f5ba
parent444a19ea3873a6e80e6152699d3e559c5ec1f483
BUG/MINOR: quic: fix malformed probing packet building

This bug arrived with this commit:

   cdfceb10a MINOR: quic: refactor qc_prep_pkts() loop

which prevents haproxy from sending PING only packets/datagrams (some
packets/datagrams with only PING frame as ack-eliciting frames inside).
Such packets/datagrams are useful in rare cases during retransmissions
when one wants to probe the peer without exceeding the anti-amplification
limit.

Modify the condition passed to qc_build_pkt() to add padding to the current
datagram. One does not want to do that when probing the peer without ack-eliciting
frames passed as <frms> parameter. Indeed qc_build_pkt() calls qc_do_build_pkt()
which supports this case: if <probe> is true (probing required), qc_do_build_pkt()
handles the case where some padding must be added to a PING only packet/datagram.
This is the case when probing with an empty <frms> frame list of ack-eliciting
frames without exceeding the anti-amplification limit from qc_dgrams_retransmit().

Add some comments to qc_build_pkt() and qc_do_build_pkt() to clarify this
as this code is easy to break!

Thank you for @Tristan971 for having reported this issue in GH #2709.

Must be backported to 3.0.
src/quic_tx.c