]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: quic-be: Allow sending 1200 bytes Initial datagrams
authorFrederic Lecaille <flecaille@haproxy.com>
Wed, 25 Jun 2025 14:04:28 +0000 (16:04 +0200)
committerFrederic Lecaille <flecaille@haproxy.com>
Thu, 26 Jun 2025 07:48:00 +0000 (09:48 +0200)
This easy to understand patch is not intrusive at all and cannot break the QUIC
listeners.

The QUIC client MUST always pad its datagrams with Initial packets. A "!l" (not
a listener) test OR'ed with the existing ones is added to satisfy the condition
to allow the build of such datagrams.

src/quic_tx.c

index 342a2dc5836b143620656a89786311d6075f06cf..8ce67bbf622e38233dbb113c5d85ba57f843cc44 100644 (file)
@@ -679,7 +679,7 @@ static int qc_prep_pkts(struct quic_conn *qc, struct buffer *buf,
                         * datagrams carrying ack-eliciting Initial packets to at least the
                         * smallest allowed maximum datagram size of 1200 bytes.
                         */
-                       if (qel == qc->iel && (!LIST_ISEMPTY(frms) || probe)) {
+                       if (qel == qc->iel && (!l || !LIST_ISEMPTY(frms) || probe)) {
                                 /* Ensure that no ack-eliciting packets are sent into too small datagrams */
                                if (end - pos < QUIC_INITIAL_PACKET_MINLEN) {
                                        TRACE_PROTO("No more enough room to build an Initial packet",
@@ -704,7 +704,7 @@ static int qc_prep_pkts(struct quic_conn *qc, struct buffer *buf,
                         */
                        cur_pkt = qc_build_pkt(&pos, end, qel, tls_ctx, frms,
                                               qc, ver, dglen, pkt_type, must_ack,
-                                              padding && !next_qel && (!probe || !LIST_ISEMPTY(frms)),
+                                              padding && (!l || (!next_qel && (!probe || !LIST_ISEMPTY(frms)))),
                                               probe, cc, &err);
                        if (!cur_pkt) {
                                switch (err) {