aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenoît Ganne <bganne@cisco.com>2020-04-17 12:09:37 +0200
committerAndrew Yourtchenko <ayourtch@gmail.com>2020-08-13 17:20:47 +0000
commit36f12ac68248229b109c77a69e6b69b3b3efd641 (patch)
tree9ce86122f4f0abd117d0d335498f3e0323fca807
parent3ef5447282b6664249f4e8f188d1378c17e1e89a (diff)
session: fix use-after-free in input node
Type: fix Change-Id: Ie60b07abe76ad166f048f5885accd7038d8153b2 Signed-off-by: Benoît Ganne <bganne@cisco.com> (cherry picked from commit 7ce23f25bbc01d534ca294ce88ab0d709e3e03a7)
-rw-r--r--src/vnet/session/session_node.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/vnet/session/session_node.c b/src/vnet/session/session_node.c
index eb5876d2c3d..ebb3503ff6b 100644
--- a/src/vnet/session/session_node.c
+++ b/src/vnet/session/session_node.c
@@ -906,6 +906,8 @@ session_tx_fifo_read_and_snd_i (session_worker_t * wrk,
return SESSION_TX_NO_BUFFERS;
}
+ transport_connection_update_tx_bytes (ctx->tc, ctx->max_len_to_snd);
+
ctx->left_to_snd = ctx->max_len_to_snd;
n_left = ctx->n_segs_per_evt;
@@ -979,7 +981,6 @@ session_tx_fifo_read_and_snd_i (session_worker_t * wrk,
vlib_buffer_free (vm, wrk->tx_buffers, n_bufs);
*n_tx_packets += ctx->n_segs_per_evt;
- transport_connection_update_tx_bytes (ctx->tc, ctx->max_len_to_snd);
SESSION_EVT (SESSION_EVT_DEQ, ctx->s, ctx->max_len_to_snd, ctx->max_dequeue,
ctx->s->tx_fifo->has_event, wrk->last_vlib_time);