diff options
author | Florin Coras <fcoras@cisco.com> | 2022-03-15 14:24:59 -0700 |
---|---|---|
committer | Damjan Marion <dmarion@me.com> | 2022-04-12 08:06:02 +0000 |
commit | c792b9f5e905c168f77ab1a262351ecd2fb4b511 (patch) | |
tree | 22587dc62bbf5e7af31374de2bcd3f6bd7b20cfe /src/vnet | |
parent | 679c0de84e01aeb096efd1c6d27155587360a877 (diff) |
tcp: limit persist segment size if window available
Type: improvement
Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Ie1ae401d5105aa42761d3cac5dfbe523f3995c87
Diffstat (limited to 'src/vnet')
-rw-r--r-- | src/vnet/tcp/tcp_output.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/vnet/tcp/tcp_output.c b/src/vnet/tcp/tcp_output.c index 88cd91330b0..f5035006822 100644 --- a/src/vnet/tcp/tcp_output.c +++ b/src/vnet/tcp/tcp_output.c @@ -1565,8 +1565,10 @@ tcp_timer_persist_handler (tcp_connection_t * tc) tcp_validate_txf_size (tc, offset); tc->snd_opts_len = tcp_make_options (tc, &tc->snd_opts, tc->state); - max_snd_bytes = clib_min (tc->snd_mss, + max_snd_bytes = clib_min (clib_min (tc->snd_mss, available_bytes), tm->bytes_per_buffer - TRANSPORT_MAX_HDRS_LEN); + if (tc->snd_wnd > 0) + max_snd_bytes = clib_min (tc->snd_wnd, max_snd_bytes); n_bytes = session_tx_fifo_peek_bytes (&tc->connection, data, offset, max_snd_bytes); b->current_length = n_bytes; |