Skip to content

Commit 96b2641

Browse files
committed
BUG/MAJOR: quic: fix wrong packet building due to already acked frames
If a packet build was asked to probe the peer with frames which have just been acked, the frames build run by qc_build_frms() could be cancelled by qc_stream_frm_is_acked() whose aim is to check that current frames to be built have not been already acknowledged. In this case the packet build run by qc_do_build_pkt() is not interrupted, leading to the build of an empty packet which should be ack-eliciting. This is a bug detected by the BUG_ON() statement in qc_do_build_pk(): BUG_ON(qel->pktns->tx.pto_probe && !(pkt->flags & QUIC_FL_TX_PACKET_ACK_ELICITING)); Thank you to @Tristan971 for having reported this issue in GH #2709 This is an old bug which must be backported as far as 2.6.
1 parent d41273c commit 96b2641

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

src/quic_tx.c

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2012,7 +2012,23 @@ static int qc_do_build_pkt(unsigned char *pos, const unsigned char *end,
20122012
goto comp_pkt_len;
20132013
}
20142014

2015-
if (!ack_frm_len && !qel->pktns->tx.pto_probe)
2015+
if (qel->pktns->tx.pto_probe) {
2016+
/* If a probing packet was asked and could not be built,
2017+
* this is not because there was not enough room, but due to
2018+
* its frames which were already acknowledeged.
2019+
* See qc_stream_frm_is_acked()) called by qc_build_frms().
2020+
* Note that qc_stream_frm_is_acked() logs a trace in this
2021+
* case mentionning some frames were already acknowledged.
2022+
*
2023+
* That said, the consequence must be the same: cancelling
2024+
* the packet build as if there was not enough room in the
2025+
* TX buffer.
2026+
*/
2027+
qel->pktns->tx.pto_probe--;
2028+
goto no_room;
2029+
}
2030+
2031+
if (!ack_frm_len)
20162032
goto no_room;
20172033
}
20182034
}

0 commit comments

Comments
 (0)