]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
Revert "BUG/MINOR: quix: Memleak for non in flight TX packets"
authorFrédéric Lécaille <flecaille@haproxy.com>
Wed, 24 Aug 2022 14:23:44 +0000 (16:23 +0200)
committerFrédéric Lécaille <flecaille@haproxy.com>
Wed, 24 Aug 2022 16:12:59 +0000 (18:12 +0200)
This reverts commit da9c441886dbfa02840a93e367f65fd6d312c835.

Indeed this commit prevented the ACK only packets to be used as other packets
when they are acknowledged. Even if not ack-eliciting packets they are
acknowledged alongside others packets. Such acknowledged ACK only packets
must be used for instance to compute the RTT.

Must be backported to 2.6 if da9c441 was backported to 2.6.

src/xprt_quic.c

index 1950f75e8238ee2ad7c119e55292204e804e4551..869debb9bd2c8a6c98a7b420922249a445b3de5b 100644 (file)
@@ -3253,21 +3253,12 @@ int qc_send_ppkts(struct buffer *buf, struct ssl_sock_ctx *ctx)
                        }
                        qc->path->in_flight += pkt->in_flight_len;
                        pkt->pktns->tx.in_flight += pkt->in_flight_len;
-                       next_pkt = pkt->next;
-                       TRACE_DATA("sent pkt", QUIC_EV_CONN_SPPKTS, qc, pkt);
-                       if (pkt->in_flight_len) {
-                               /* Ack-eliciting packets or packets with a PADDING frame */
-                               quic_tx_packet_refinc(pkt);
-                               eb64_insert(&pkt->pktns->tx.pkts, &pkt->pn_node);
+                       if (pkt->in_flight_len)
                                qc_set_timer(qc);
-                       }
-                       else {
-                               /* Note that we can safely free this packet: There is no
-                                * ack-eliciting frame attached to it. This may be an ACK
-                                * or CONNECTION_CLOSE only packet for instance.
-                                */
-                               pool_free(pool_head_quic_tx_packet, pkt);
-                       }
+                       TRACE_DATA("sent pkt", QUIC_EV_CONN_SPPKTS, qc, pkt);
+                       next_pkt = pkt->next;
+                       quic_tx_packet_refinc(pkt);
+                       eb64_insert(&pkt->pktns->tx.pkts, &pkt->pn_node);
                }
        }