From 39ba1c3e125a9b8f61be05fb4b1cdff9068f65d3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Fr=C3=A9d=C3=A9ric=20L=C3=A9caille?= Date: Fri, 21 Jan 2022 16:52:56 +0100 Subject: [PATCH] MINOR: quic: Wrong packet number space selection It is possible that the listener is in INITIAL state, but have to probe with Handshake packets. In this case, when entering qc_prep_pkts() there is nothing to do. We must select the next packet number space (or encryption level) to be able to probe with such packet type. --- src/xprt_quic.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/xprt_quic.c b/src/xprt_quic.c index 415f6993bb..a880598845 100644 --- a/src/xprt_quic.c +++ b/src/xprt_quic.c @@ -2574,6 +2574,14 @@ static int qc_prep_pkts(struct quic_conn *qc, struct qring *qr, */ if (prv_pkt) qc_set_dg(cbuf, dglen, first_pkt); + /* Let's select the next encryption level */ + if (tel != next_tel && next_tel != QUIC_TLS_ENC_LEVEL_NONE) { + tel = next_tel; + qel = &qc->els[tel]; + /* Build a new datagram */ + prv_pkt = NULL; + continue; + } break; } -- 2.47.3