X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;ds=sidebyside;f=src%2Fvnet%2Fsctp%2Fsctp_output.c;h=3c2099a08fdd041e031283141ee122abea2ad53f;hb=1cfcb78940580c8e3645fca0419d32f9286e942d;hp=8863012c0417bd4de4028a16f63a62c2c6f8d0c6;hpb=a5a458f3807f549c2519781c7a08d30cbfce0bf0;p=vpp.git diff --git a/src/vnet/sctp/sctp_output.c b/src/vnet/sctp/sctp_output.c index 8863012c041..3c2099a08fd 100644 --- a/src/vnet/sctp/sctp_output.c +++ b/src/vnet/sctp/sctp_output.c @@ -1334,11 +1334,14 @@ 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)); + || (b->flags & VLIB_BUFFER_NEXT_PRESENT) + || !(b->flags & VLIB_BUFFER_TOTAL_LENGTH_VALID)); SCTP_ADV_DBG_OUTPUT ("b->current_length = %u, " "b->current_data = %p "