aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2023-01-09 16:00:10 -0800
committerDave Barach <vpp@barachs.net>2023-01-10 02:49:29 +0000
commitc21775bd5c64ae99556761df01b7a06690de3df9 (patch)
treea4ec2c583cbc0e6bad95fab650331697275c54b5 /src
parent6d39c1e07ee681d1c36a968b11269cb2ecca7edc (diff)
session: avoid trying to send incomplete dgram
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Signed-off-by: Steven Luong <sluong@cisco.com> Change-Id: Ibebe9e4ab7331c3ae66c9502e910368acaba51ec
Diffstat (limited to 'src')
-rw-r--r--src/vnet/session/session_node.c5
1 files 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;