]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: quic: enforce ACK reception is handled in order
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Tue, 6 Aug 2024 14:30:42 +0000 (16:30 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Wed, 7 Aug 2024 09:08:20 +0000 (11:08 +0200)
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.

src/quic_stream.c

index 9741f8e710016e0e24668c879e76690846bec6da..6a470488e5758ddb3884995d2f1d70ed89870ebc 100644 (file)
@@ -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;