From c21775bd5c64ae99556761df01b7a06690de3df9 Mon Sep 17 00:00:00 2001 From: Florin Coras Date: Mon, 9 Jan 2023 16:00:10 -0800 Subject: session: avoid trying to send incomplete dgram Type: fix Signed-off-by: Florin Coras Signed-off-by: Steven Luong Change-Id: Ibebe9e4ab7331c3ae66c9502e910368acaba51ec --- src/vnet/session/session_node.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/vnet/session/session_node.c b/src/vnet/session/session_node.c index f819ee6847d..fd57f08aed7 100644 --- a/src/vnet/session/session_node.c +++ b/src/vnet/session/session_node.c @@ -1253,8 +1253,9 @@ session_tx_set_dequeue_params (vlib_main_t * vm, session_tx_context_t * ctx, (u8 *) & hdr); ASSERT (hdr.data_length > hdr.data_offset); dgram_len = hdr.data_length - hdr.data_offset; - if (len + dgram_len > ctx->max_dequeue - || first_dgram_len != dgram_len) + if (offset + sizeof (hdr) + hdr.data_length > + ctx->max_dequeue || + first_dgram_len != dgram_len) break; len += dgram_len; offset += sizeof (hdr) + hdr.data_length; -- cgit 1.2.3-korg