From: Frédéric Lécaille Date: Fri, 19 Aug 2022 07:32:14 +0000 (+0200) Subject: BUG/MINOR: quic: Wrong splitted duplicated frames handling X-Git-Tag: v2.7-dev4~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b827840b425b9c8da36a4a2180e816c76c28259c;p=thirdparty%2Fhaproxy.git BUG/MINOR: quic: Wrong splitted duplicated frames handling When duplicated frames are splitted, we must propagate this information to the new allocated frame and add a reference to this new frame to the reference list of the original frame. Must be backported to 2.6 --- diff --git a/src/xprt_quic.c b/src/xprt_quic.c index 8c44ab3391..baee8e242b 100644 --- a/src/xprt_quic.c +++ b/src/xprt_quic.c @@ -6415,6 +6415,13 @@ static inline int qc_build_frms(struct list *outlist, struct list *inlist, new_cf->crypto.len = dlen; new_cf->crypto.offset = cf->crypto.offset; new_cf->crypto.qel = qel; + TRACE_DEVEL("splitted frame", QUIC_EV_CONN_PRSAFRM, qc, new_cf); + if (cf->origin) { + TRACE_DEVEL("duplicated frame", QUIC_EV_CONN_PRSAFRM, qc); + /* This frame was duplicated */ + LIST_APPEND(&cf->origin->reflist, &new_cf->ref); + new_cf->origin = cf->origin; + } LIST_APPEND(outlist, &new_cf->list); /* Consume bytes of the current frame. */ cf->crypto.len -= dlen; @@ -6525,6 +6532,13 @@ static inline int qc_build_frms(struct list *outlist, struct list *inlist, /* FIN bit reset */ new_cf->type &= ~QUIC_STREAM_FRAME_TYPE_FIN_BIT; new_cf->stream.data = cf->stream.data; + TRACE_DEVEL("splitted frame", QUIC_EV_CONN_PRSAFRM, qc, new_cf); + if (cf->origin) { + TRACE_DEVEL("duplicated frame", QUIC_EV_CONN_PRSAFRM, qc); + /* This frame was duplicated */ + LIST_APPEND(&cf->origin->reflist, &new_cf->ref); + new_cf->origin = cf->origin; + } LIST_APPEND(outlist, &new_cf->list); cf->type |= QUIC_STREAM_FRAME_TYPE_OFF_BIT; /* Consume bytes of the current frame. */