]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: quic: 1RTT packets ignored after mux was released
authorFrédéric Lécaille <flecaille@haproxy.com>
Mon, 21 Mar 2022 10:37:13 +0000 (11:37 +0100)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Mon, 21 Mar 2022 13:27:09 +0000 (14:27 +0100)
We must be able to handle 1RTT packets after the mux has terminated its job
(qc->mux_state == QC_MUX_RELEASED). So the condition (qc->mux_state != QC_MUX_READY)
in qc_qel_may_rm_hp() is not correct when we want to wait for the mux to be started.
Add a check in qc_parse_pkt_frms() to ensure is started before calling it. All
the STREAM frames will be ignored when the mux will be released.

src/xprt_quic.c

index 3e4dd9290cabd5b19759b53fa53822ce3ffb1ef2..b9723d937262c681f882a5db9c3a308884997cd9 100644 (file)
@@ -2428,6 +2428,10 @@ static int qc_parse_pkt_frms(struct quic_rx_packet *pkt, struct ssl_sock_ctx *ct
                        } else if (!(stream->id & QUIC_STREAM_FRAME_ID_INITIATOR_BIT))
                                goto err;
 
+                       /* At the application layer the connection may have already been closed. */
+                       if (qc->mux_state != QC_MUX_READY)
+                               break;
+
                        if (!qc_handle_strm_frm(pkt, stream, qc))
                                goto err;
 
@@ -3374,7 +3378,7 @@ static int qc_qel_may_rm_hp(struct quic_conn *qc, struct quic_enc_level *qel)
 
        /* check if the connection layer is ready before using app level */
        if ((tel == QUIC_TLS_ENC_LEVEL_APP || tel == QUIC_TLS_ENC_LEVEL_EARLY_DATA) &&
-           qc->mux_state != QC_MUX_READY)
+           qc->mux_state == QC_MUX_NULL)
                return 0;
 
        return 1;