diff options
author | Ivan Shvedunov <ivan4th@gmail.com> | 2021-03-15 19:05:14 +0300 |
---|---|---|
committer | Florin Coras <florin.coras@gmail.com> | 2021-03-17 15:01:13 +0000 |
commit | f3b5d702c11bb2b1c1691c155fd620d65d1fd4ce (patch) | |
tree | 8e77e82f681ab9ac95393ef2d2b0838adbf0c5bd /src | |
parent | eb506becd038f081bc7ac340412d3685425bb8b4 (diff) |
session: fix populating chained buffers
Type: fix
Signed-off-by: Ivan Shvedunov <ivan4th@gmail.com>
Change-Id: I3fdc1711d508bc5b0c2f56b3bd3fb4a56056eb54
Diffstat (limited to 'src')
-rw-r--r-- | src/vnet/session/session_node.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/vnet/session/session_node.c b/src/vnet/session/session_node.c index f5e8478aaf3..7ceb9ea1f10 100644 --- a/src/vnet/session/session_node.c +++ b/src/vnet/session/session_node.c @@ -632,16 +632,18 @@ session_tx_fifo_chain_tail (vlib_main_t * vm, session_tx_context_t * ctx, svm_fifo_t *f = ctx->s->tx_fifo; session_dgram_hdr_t *hdr = &ctx->hdr; u16 deq_now; + u32 offset; + deq_now = clib_min (hdr->data_length - hdr->data_offset, len_to_deq); - n_bytes_read = svm_fifo_peek (f, hdr->data_offset, deq_now, - data); + offset = hdr->data_offset + SESSION_CONN_HDR_LEN; + n_bytes_read = svm_fifo_peek (f, offset, deq_now, data); ASSERT (n_bytes_read > 0); hdr->data_offset += n_bytes_read; if (hdr->data_offset == hdr->data_length) { - u32 offset = hdr->data_length + SESSION_CONN_HDR_LEN; + offset = hdr->data_length + SESSION_CONN_HDR_LEN; svm_fifo_dequeue_drop (f, offset); if (ctx->left_to_snd > n_bytes_read) svm_fifo_peek (ctx->s->tx_fifo, 0, sizeof (ctx->hdr), |