From: Frédéric Lécaille Date: Fri, 21 Jan 2022 15:52:56 +0000 (+0100) Subject: MINOR: quic: Wrong packet number space selection X-Git-Tag: v2.6-dev1~99 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=39ba1c3e125a9b8f61be05fb4b1cdff9068f65d3;p=thirdparty%2Fhaproxy.git 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. --- 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; }