]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: quic: do not drop packet on duplicate stream/decoding error
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Tue, 8 Mar 2022 09:48:35 +0000 (10:48 +0100)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Tue, 8 Mar 2022 13:36:32 +0000 (14:36 +0100)
Change the return value to success in qc_handle_bidi_strm_frm for two
specific cases :
* if STREAM frame is an already received offset
* if application decoding failed

This ensures that the packet is not dropped and properly acknowledged.
Previous to this fix, the return code was set to error which prevented
the ACK to be generated.

The impact of the bug might be noticeable in environment with packet
loss and retransmission. Due to haproxy not generating ACK for packets
containing STREAM frames with already received offset, the client will
probably retransmit them again, which will worsen the network
transmission.

src/xprt_quic.c

index fee009c5f654f69e29e591c4ebb2401c5a746060..66b6e4fbc22e100dbbef463992cddebfc3379845 100644 (file)
@@ -2006,7 +2006,7 @@ static int qc_handle_bidi_strm_frm(struct quic_rx_packet *pkt,
 
        /* invalid or already received frame */
        if (ret == 1)
-               return 0;
+               return 1;
 
        if (ret == 2) {
                /* frame cannot be parsed at the moment and should be
@@ -2052,8 +2052,7 @@ static int qc_handle_bidi_strm_frm(struct quic_rx_packet *pkt,
        }
 
        /* Decode the received data. */
-       if (qcc_decode_qcs(qc->qcc, qcs))
-               return 0;
+       qcc_decode_qcs(qc->qcc, qcs);
 
        return 1;
 }