]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: quic: Avoid BUG_ON() on ->on_pkt_lost() BBR callback call
authorFrederic Lecaille <flecaille@haproxy.com>
Fri, 22 Nov 2024 14:40:05 +0000 (15:40 +0100)
committerFrederic Lecaille <flecaille@haproxy.com>
Fri, 22 Nov 2024 14:51:29 +0000 (15:51 +0100)
The per-packet delivery rate sample is applied to ack-eliciting packet only
calling ->drs_on_transmit() BBR callback. So, ->on_pkt_lost() which inspects the
delivery rate sampling information during packet loss detection must not be
called for non ack-eliciting packet. If not, it would be facing with non
initialized variables with big chance to trigger a BUG_ON().

As BBR is implemented in the current developement version, there is
no need to backport this patch.

src/quic_loss.c

index 6cce844689e146dc3e76593980230fe9d464eddd..592b613c750bffc5bfc51c83c4d7e7f52def2e99 100644 (file)
@@ -216,7 +216,9 @@ void qc_packet_loss_lookup(struct quic_pktns *pktns, struct quic_conn *qc,
                if (tick_is_le(loss_time_limit, now_ms) || reordered) {
                        struct quic_cc *cc = &qc->path->cc;
 
-                       if (cc->algo->on_pkt_lost)
+                       /* Delivery rate sampling is applied to ack-eliciting packet only. */
+                       if ((pkt->flags & QUIC_FL_TX_PACKET_ACK_ELICITING) &&
+                           cc->algo->on_pkt_lost)
                                cc->algo->on_pkt_lost(cc, pkt, pkt->rs.lost);
                        eb64_delete(&pkt->pn_node);
                        LIST_APPEND(lost_pkts, &pkt->list);