From: William Dauchy <[email protected]>

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 <[email protected]>
---
 src/quic_rx.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/quic_rx.c b/src/quic_rx.c
index fb54d7867..76bb47b43 100644
--- a/src/quic_rx.c
+++ b/src/quic_rx.c
@@ -2093,9 +2093,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;
                        }
-- 
2.56.0



Reply via email to