]> git.kaiwu.me - haproxy.git/commitdiff
BUG/MINOR: quic-be: fix Initial token length check on backend connections
authorWilliam Dauchy <wdauchy@gmail.com>
Sat, 7 Nov 2026 19:44:30 +0000 (20:44 +0100)
committerFrederic Lecaille <flecaille@haproxy.com>
Thu, 12 Nov 2026 15:20:13 +0000 (16:20 +0100)
The check rejecting server Initial packets with a non-zero token length
tests pkt->token_len before it is set, so it never matches. Test the
parsed <token_len> value instead, as required by RFC 9000 17.2.2.

This should be backported up to 3.3, where it was introduced by 43d88a44f
("MINOR: quic-be: Datagrams and packet parsing support").

Signed-off-by: William Dauchy <wdauchy@gmail.com>
src/quic_rx.c

index 92d84ef4b6f456788a9f87a4847b732f29e72da0..657269e6b200350a3b4a90e4f436692bf9840e6c 100644 (file)
@@ -2117,9 +2117,9 @@ static int quic_rx_pkt_parse(struct quic_conn *qc, struct quic_rx_packet *pkt,
                                goto drop;
                        }
 
-                       if (!l && pkt->token_len) {
+                       if (!l && token_len) {
                                /* A server must sent Initial packets with a null token length. */
-                               TRACE_PROTO("Packet dropped",
+                               TRACE_PROTO("RX Initial packet with non-zero token length on backend",
                                            QUIC_EV_CONN_LPKT, NULL, NULL, NULL, pkt->version);
                                goto drop;
                        }