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.
This commit is contained in:
Amaury Denoyelle 2024-08-06 16:30:42 +02:00
parent e177cf341c
commit b2282082dd

View 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;