mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-25 07:41:36 +02:00
BUG/MINOR: quic: Dropped retransmitted STREAM frames
It is possible that we continue to receive retransmitted STREAM frames after the mux have been released. We rely on the ->rx.streams[].nb_streams counter to check the stream was closed. If not, at this time we drop the packet.
This commit is contained in:
parent
664741e1c5
commit
d62240c9e5
@ -2689,6 +2689,7 @@ static int qc_parse_pkt_frms(struct quic_rx_packet *pkt, struct ssl_sock_ctx *ct
|
|||||||
case QUIC_FT_STREAM_8 ... QUIC_FT_STREAM_F:
|
case QUIC_FT_STREAM_8 ... QUIC_FT_STREAM_F:
|
||||||
{
|
{
|
||||||
struct quic_stream *stream = &frm.stream;
|
struct quic_stream *stream = &frm.stream;
|
||||||
|
unsigned nb_streams = qc->rx.strms[qcs_id_type(stream->id)].nb_streams;
|
||||||
|
|
||||||
if (qc_is_listener(ctx->qc)) {
|
if (qc_is_listener(ctx->qc)) {
|
||||||
if (stream->id & QUIC_STREAM_FRAME_ID_INITIATOR_BIT)
|
if (stream->id & QUIC_STREAM_FRAME_ID_INITIATOR_BIT)
|
||||||
@ -2696,12 +2697,17 @@ 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))
|
} else if (!(stream->id & QUIC_STREAM_FRAME_ID_INITIATOR_BIT))
|
||||||
goto err;
|
goto err;
|
||||||
|
|
||||||
/* The upper layer may not be allocated.
|
/* The upper layer may not be allocated. */
|
||||||
*
|
if (qc->mux_state != QC_MUX_READY) {
|
||||||
* TODO emit a CONNECTION_CLOSE if mux already freed.
|
if ((stream->id >> QCS_ID_TYPE_SHIFT) < nb_streams) {
|
||||||
*/
|
TRACE_PROTO("Already closed stream", QUIC_EV_CONN_PRSHPKT, qc);
|
||||||
if (qc->mux_state != QC_MUX_READY)
|
break;
|
||||||
goto err;
|
}
|
||||||
|
else {
|
||||||
|
TRACE_PROTO("Stream not found", QUIC_EV_CONN_PRSHPKT, qc);
|
||||||
|
goto err;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!qc_handle_strm_frm(pkt, stream, qc))
|
if (!qc_handle_strm_frm(pkt, stream, qc))
|
||||||
goto err;
|
goto err;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user