summaryrefslogtreecommitdiffstats
path: root/src/vnet/tcp/tcp_output.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/vnet/tcp/tcp_output.c')
-rw-r--r--src/vnet/tcp/tcp_output.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/vnet/tcp/tcp_output.c b/src/vnet/tcp/tcp_output.c
index 9cb3e77937e..b843c926afe 100644
--- a/src/vnet/tcp/tcp_output.c
+++ b/src/vnet/tcp/tcp_output.c
@@ -439,14 +439,16 @@ tcp_init_mss (tcp_connection_t * tc)
always_inline int
tcp_alloc_tx_buffers (tcp_main_t * tm, u8 thread_index, u32 n_free_buffers)
{
+ vlib_main_t *vm = vlib_get_main ();
u32 current_length = vec_len (tm->tx_buffers[thread_index]);
+ u32 n_allocated;
vec_validate (tm->tx_buffers[thread_index],
current_length + n_free_buffers - 1);
- _vec_len (tm->tx_buffers[thread_index]) = current_length
- + vlib_buffer_alloc (vlib_get_main (),
- &tm->tx_buffers[thread_index][current_length],
- n_free_buffers);
+ n_allocated =
+ vlib_buffer_alloc (vm, &tm->tx_buffers[thread_index][current_length],
+ n_free_buffers);
+ _vec_len (tm->tx_buffers[thread_index]) = current_length + n_allocated;
/* buffer shortage, report failure */
if (vec_len (tm->tx_buffers[thread_index]) == 0)
{