aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/tcp/tcp_output.c
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2019-03-06 16:51:58 -0800
committerDave Barach <openvpp@barachs.net>2019-03-08 20:03:22 +0000
commit7e74bf39ecd97f6bf79bde70d07f907548a83783 (patch)
tree3ade1725864111440af908dc1db917e7bfdf0763 /src/vnet/tcp/tcp_output.c
parent11e2cf5f1a37965001efee6a921a3fb2aabcddf6 (diff)
tcp: fix window probes in fin-wait-1
Change-Id: Idf060f385f4d9b2f42fdab6a1d372727beb8b19e Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/vnet/tcp/tcp_output.c')
-rw-r--r--src/vnet/tcp/tcp_output.c23
1 files changed, 9 insertions, 14 deletions
diff --git a/src/vnet/tcp/tcp_output.c b/src/vnet/tcp/tcp_output.c
index 66651e87fe2..94f96b6fb62 100644
--- a/src/vnet/tcp/tcp_output.c
+++ b/src/vnet/tcp/tcp_output.c
@@ -1096,18 +1096,14 @@ tcp_make_state_flags (tcp_connection_t * tc, tcp_state_t next_state)
case TCP_STATE_CLOSE_WAIT:
case TCP_STATE_TIME_WAIT:
case TCP_STATE_FIN_WAIT_2:
+ case TCP_STATE_CLOSING:
+ case TCP_STATE_LAST_ACK:
+ case TCP_STATE_FIN_WAIT_1:
return TCP_FLAG_ACK;
case TCP_STATE_SYN_RCVD:
return TCP_FLAG_SYN | TCP_FLAG_ACK;
case TCP_STATE_SYN_SENT:
return TCP_FLAG_SYN;
- case TCP_STATE_LAST_ACK:
- case TCP_STATE_FIN_WAIT_1:
- case TCP_STATE_CLOSING:
- if (tc->snd_nxt + 1 < tc->snd_una_max)
- return TCP_FLAG_ACK;
- else
- return TCP_FLAG_FIN;
default:
clib_warning ("Shouldn't be here!");
}
@@ -1709,7 +1705,6 @@ tcp_timer_persist_handler (u32 index)
u8 *data;
tc = tcp_connection_get_if_valid (index, thread_index);
-
if (!tc)
return;
@@ -1717,8 +1712,8 @@ tcp_timer_persist_handler (u32 index)
tc->timers[TCP_TIMER_PERSIST] = TCP_TIMER_HANDLE_INVALID;
/* Problem already solved or worse */
- if (tc->state == TCP_STATE_CLOSED || tc->state > TCP_STATE_ESTABLISHED
- || tc->snd_wnd > tc->snd_mss)
+ if (tc->state == TCP_STATE_CLOSED || tc->snd_wnd > tc->snd_mss
+ || (tc->flags & TCP_CONN_FINSNT))
return;
available_bytes = transport_max_tx_dequeue (&tc->connection);
@@ -1755,10 +1750,10 @@ tcp_timer_persist_handler (u32 index)
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, tm->bytes_per_buffer - TRANSPORT_MAX_HDRS_LEN);
- n_bytes =
- session_tx_fifo_peek_bytes (&tc->connection, data, offset, max_snd_bytes);
+ max_snd_bytes = clib_min (tc->snd_mss,
+ tm->bytes_per_buffer - TRANSPORT_MAX_HDRS_LEN);
+ n_bytes = session_tx_fifo_peek_bytes (&tc->connection, data, offset,
+ max_snd_bytes);
b->current_length = n_bytes;
ASSERT (n_bytes != 0 && (tcp_timer_is_active (tc, TCP_TIMER_RETRANSMIT)
|| tc->snd_nxt == tc->snd_una_max