]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: quic: Wrong splitted duplicated frames handling
authorFrédéric Lécaille <flecaille@haproxy.com>
Fri, 19 Aug 2022 07:32:14 +0000 (09:32 +0200)
committerFrédéric Lécaille <flecaille@haproxy.com>
Fri, 19 Aug 2022 08:10:43 +0000 (10:10 +0200)
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

src/xprt_quic.c

index 8c44ab33911ff11d7f75e04d0137fb009e9256ef..baee8e242b920671d99943797d3501ecc0daeef0 100644 (file)
@@ -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 <cf> frame was duplicated */
+                                       LIST_APPEND(&cf->origin->reflist, &new_cf->ref);
+                                       new_cf->origin = cf->origin;
+                               }
                                LIST_APPEND(outlist, &new_cf->list);
                                /* Consume <dlen> 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 <cf> 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 <dlen> bytes of the current frame. */