From 331c428a9c5f4686a9102eba9715233cceb43d55 Mon Sep 17 00:00:00 2001 From: Dave Wallace Date: Tue, 19 Nov 2019 15:45:26 +0000 Subject: quic: handle duplicate packet from quicly Type: fix Signed-off-by: Dave Wallace Change-Id: Ia4b1eb3c704374e27b260d88ae6ab628754468d3 --- src/plugins/quic/quic.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'src/plugins') diff --git a/src/plugins/quic/quic.c b/src/plugins/quic/quic.c index 04e6ab8231b..f3297f99ac7 100644 --- a/src/plugins/quic/quic.c +++ b/src/plugins/quic/quic.c @@ -500,10 +500,23 @@ quic_on_receive (quicly_stream_t * stream, size_t off, const void *src, max_enq = svm_fifo_max_enqueue_prod (f); QUIC_DBG (3, "Enqueuing %u at off %u in %u space", len, off, max_enq); - if (off - stream_data->app_rx_data_len + len > max_enq) + /* Handle duplicate packet/chunk from quicly */ + if (off < stream_data->app_rx_data_len) + { + QUIC_DBG (3, "Session [idx %u, app_wrk %u, thread %u, rx-fifo 0x%llx]: " + "DUPLICATE PACKET (max_enq %u, len %u, " + "app_rx_data_len %u, off %u, ToBeNQ %u)", + stream_session->session_index, + stream_session->app_wrk_index, + stream_session->thread_index, f, + max_enq, len, stream_data->app_rx_data_len, off, + off - stream_data->app_rx_data_len + len); + return 0; + } + if (PREDICT_FALSE ((off - stream_data->app_rx_data_len + len) > max_enq)) { QUIC_ERR ("Session [idx %u, app_wrk %u, thread %u, rx-fifo 0x%llx]: " - "RX fifo is full (max_enq %u, len %u, " + "RX FIFO IS FULL (max_enq %u, len %u, " "app_rx_data_len %u, off %u, ToBeNQ %u)", stream_session->session_index, stream_session->app_wrk_index, -- cgit 1.2.3-korg