BUG/MEDIUM: quic: do not drop packet on duplicate stream/decoding error

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.
This commit is contained in:
Amaury Denoyelle 2022-03-08 10:48:35 +01:00
parent b0dfd099c5
commit 20f89cac95

View 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;
}