]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: quic: Wrong rtt variance computing
authorFrédéric Lécaille <flecaille@haproxy.com>
Thu, 30 Mar 2023 13:31:06 +0000 (15:31 +0200)
committerFrédéric Lécaille <flecaille@haproxy.com>
Fri, 31 Mar 2023 11:41:17 +0000 (13:41 +0200)
In ->srtt quic_loss struct this is 8*srtt which is stored so that not to have to multiply/devide
it to compute the RTT variance (at least). This is where there was a bug in quic_loss_srtt_update():
each time ->srtt must be used, it must be devided by 8 or right shifted by 3.
This bug had a very bad impact for network with non negligeable packet loss.

Must be backported to 2.6 and 2.7.

src/quic_loss.c

index 8f19645a703f700b128e7943f7af47bb0ac34564..eff8e6c36c80bb6f7f8124a5993df96553de2b6e 100644 (file)
@@ -37,7 +37,7 @@ void quic_loss_srtt_update(struct quic_loss *ql,
                /* Specific to QUIC (RTT adjustment). */
                if (ack_delay && rtt > ql->rtt_min + ack_delay)
                        rtt -= ack_delay;
-               diff = ql->srtt - rtt;
+               diff = (ql->srtt >> 3) - rtt;
                if (diff < 0)
                        diff = -diff;
                /* 4*rttvar = 3*rttvar + |diff| */