]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: quic: Wrong packet number space selection
authorFrédéric Lécaille <flecaille@haproxy.com>
Fri, 21 Jan 2022 15:52:56 +0000 (16:52 +0100)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Fri, 21 Jan 2022 16:38:11 +0000 (17:38 +0100)
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

index 415f6993bbf7bec3c6164badbaba58e231bf9035..a880598845473f714b554127cc21c293ffaa461b 100644 (file)
@@ -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;
                }