From: Amaury Denoyelle Date: Tue, 6 Aug 2024 14:30:42 +0000 (+0200) Subject: MINOR: quic: enforce ACK reception is handled in order X-Git-Tag: v3.1-dev5~38 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b2282082dd163be8a083f505fa3c864d2d15e174;p=thirdparty%2Fhaproxy.git MINOR: quic: enforce ACK reception is handled in order Add a new BUG_ON() in qc-stream_desc_ack(). It ensures that acknowledgement are always notify in-order. This is because out-of-order ACKs cannot be handled by qc_stream_desc layer which does not support gap in STREAM sent data. Prior to this fix, out-of-order ACKs are simply ignored without any error. This currently cannot happen thanks to careful qc_stream_desc_ack() invokation. If this assumption is broken in the future by inatteion, this would cause loss of ACK notification which will prevent qc_stream_desc release. --- diff --git a/src/quic_stream.c b/src/quic_stream.c index 9741f8e710..6a470488e5 100644 --- a/src/quic_stream.c +++ b/src/quic_stream.c @@ -156,7 +156,10 @@ int qc_stream_desc_ack(struct qc_stream_desc **stream, size_t offset, size_t len /* Cannot advertise FIN for an inferior data range. */ BUG_ON(fin && offset + len < s->ack_offset); - if (offset + len < s->ack_offset || offset > s->ack_offset) + /* No support now for out-of-order ACK reporting. */ + BUG_ON(offset > s->ack_offset); + + if (offset + len < s->ack_offset) return 0; diff = offset + len - s->ack_offset;