]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: quic: Probe regardless of the congestion control
authorFrédéric Lécaille <flecaille@haproxy.com>
Mon, 17 Jan 2022 16:56:20 +0000 (17:56 +0100)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 20 Jan 2022 15:43:06 +0000 (16:43 +0100)
When probing, we must not take into an account the congestion control window.
This was not completely correctly implemented: qc_build_frms() could fail
because of this limit when comparing the head of the packet againts the
congestion control window. With this patch we make it fail only when
we are not probing.

src/xprt_quic.c

index e5b7c7d62b305d59e0ef8cbdf5e465bc89e5da38..2604f83678614c001e8e97dce4e7deefa250d4a8 100644 (file)
@@ -4617,17 +4617,23 @@ static inline int qc_build_frms(struct list *l,
 {
        int ret;
        struct quic_frame *cf, *cfbak;
-       size_t remain = quic_path_prep_data(qc->path);
 
        ret = 0;
-       if (*len > room || headlen > remain)
+       if (*len > room)
                return 0;
 
        /* If we are not probing we must take into an account the congestion
         * control window.
         */
-       if (!qel->pktns->tx.pto_probe)
-               room = QUIC_MIN(room, quic_path_prep_data(qc->path) - headlen);
+       if (!qel->pktns->tx.pto_probe) {
+               size_t remain = quic_path_prep_data(qc->path);
+
+               if (headlen > remain)
+                       return 0;
+
+               room = QUIC_MIN(room, remain - headlen);
+       }
+
        TRACE_PROTO("************** frames build (headlen)",
                    QUIC_EV_CONN_BCFRMS, qc, &headlen);
        list_for_each_entry_safe(cf, cfbak, &qel->pktns->tx.frms, list) {