BUG/MINOR: quic: Ensure not to retransmit packets with no ack-eliciting frames
Even if there is a check in callers of qc_prep_hdshk_fast_retrans() and
qc_prep_fast_retrans() to prevent retransmissions of packets with no ack-eliciting
frames, these two functions should pay attention not do to that especially if
someone decides to modify their implementations in the future.
Must be backported to 2.6 and 2.7.
diff --git a/src/quic_conn.c b/src/quic_conn.c
index 85513bc..7c2ee64 100644
--- a/src/quic_conn.c
+++ b/src/quic_conn.c
@@ -2616,14 +2616,18 @@
node = eb64_first(pkts);
start:
while (node) {
- pkt = eb64_entry(node, struct quic_tx_packet, pn_node);
+ struct quic_tx_packet *p;
+
+ p = eb64_entry(node, struct quic_tx_packet, pn_node);
node = eb64_next(node);
/* Skip the empty and coalesced packets */
TRACE_PRINTF(TRACE_LEVEL_DEVELOPER, QUIC_EV_CONN_SPPKTS, qc, 0, 0, 0,
- "--> pn=%llu (%d %d)", (ull)pkt->pn_node.key,
- LIST_ISEMPTY(&pkt->frms), !!(pkt->flags & QUIC_FL_TX_PACKET_COALESCED));
- if (!LIST_ISEMPTY(&pkt->frms))
+ "--> pn=%llu (%d %d)", (ull)p->pn_node.key,
+ LIST_ISEMPTY(&p->frms), !!(p->flags & QUIC_FL_TX_PACKET_COALESCED));
+ if (!LIST_ISEMPTY(&p->frms)) {
+ pkt = p;
break;
+ }
}
if (!pkt)
@@ -2674,12 +2678,17 @@
node = eb64_first(pkts);
/* Skip the empty packet (they have already been retransmitted) */
while (node) {
- pkt = eb64_entry(node, struct quic_tx_packet, pn_node);
+ struct quic_tx_packet *p;
+
+ p = eb64_entry(node, struct quic_tx_packet, pn_node);
TRACE_PRINTF(TRACE_LEVEL_DEVELOPER, QUIC_EV_CONN_SPPKTS, qc, 0, 0, 0,
- "--> pn=%llu (%d %d)", (ull)pkt->pn_node.key,
- LIST_ISEMPTY(&pkt->frms), !!(pkt->flags & QUIC_FL_TX_PACKET_COALESCED));
- if (!LIST_ISEMPTY(&pkt->frms) && !(pkt->flags & QUIC_FL_TX_PACKET_COALESCED))
+ "--> pn=%llu (%d %d)", (ull)p->pn_node.key,
+ LIST_ISEMPTY(&p->frms), !!(p->flags & QUIC_FL_TX_PACKET_COALESCED));
+ if (!LIST_ISEMPTY(&p->frms) && !(p->flags & QUIC_FL_TX_PACKET_COALESCED)) {
+ pkt = p;
break;
+ }
+
node = eb64_next(node);
}