tcp: timestamp adjustment
[vpp.git] / src / vnet / sctp / sctp_output.c
index 8863012..3c2099a 100644 (file)
@@ -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 "