aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSirshak das <sirshak.das@arm.com>2019-03-06 09:51:02 -0500
committerFlorin Coras <florin.coras@gmail.com>2019-03-06 18:57:23 +0000
commitfb6c75293cb82501f80975c6a46365ab14d7a85a (patch)
treef0de652ee764020c7ae6ab7986a67ec71366b1e2 /src
parentc0737e962ca913763e4cc3aa516a2dfffe46659e (diff)
sctp chunk_len fix
total_length_not_including_first_buffer should only be used when VLIB_BUFFER_TOTAL_LENGTH_VALID is set, if not it uses stale data from previous session_chain_tail calculation to set data/chunk len. Change-Id: I9802341e522cf9b18d0aef817f0047b76945782e Signed-off-by: Sirshak Das <sirshak.das@arm.com> Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Diffstat (limited to 'src')
-rw-r--r--src/vnet/sctp/sctp_output.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/vnet/sctp/sctp_output.c b/src/vnet/sctp/sctp_output.c
index 8863012c041..e76f67b3e3e 100644
--- a/src/vnet/sctp/sctp_output.c
+++ b/src/vnet/sctp/sctp_output.c
@@ -1334,8 +1334,10 @@ static void
sctp_push_hdr_i (sctp_connection_t * sctp_conn, vlib_buffer_t * b,
sctp_state_t next_state)
{
- u16 data_len =
- b->current_length + b->total_length_not_including_first_buffer;
+ u16 data_len = b->current_length;
+
+ if (b->flags & VLIB_BUFFER_TOTAL_LENGTH_VALID)
+ data_len += b->total_length_not_including_first_buffer;
ASSERT (!b->total_length_not_including_first_buffer
|| (b->flags & VLIB_BUFFER_NEXT_PRESENT));