summaryrefslogtreecommitdiffstats
path: root/src/vnet/tcp/tcp_output.c
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2017-09-28 23:49:42 -0400
committerDamjan Marion <dmarion.lists@gmail.com>2017-10-03 11:05:55 +0000
commita096f2d182537cb292241af4cc842d21e5369617 (patch)
treec4002e227655714b9b5c8e4c3029261ca5907198 /src/vnet/tcp/tcp_output.c
parentb4d3c96f89bb832203092dcc94eeaa11a906594c (diff)
tcp: updates to connection closing procedure (VPP-996)
- add separate TIME_WAIT time constant - fix output node for TIME_WAIT acks - ensure snd_nxt is snd_una_max after retransmitting fin - debugging improvements Change-Id: Ic947153346979853f2526824b229126e47aead86 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.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/vnet/tcp/tcp_output.c b/src/vnet/tcp/tcp_output.c
index a954bfa7b4e..6482e894348 100644
--- a/src/vnet/tcp/tcp_output.c
+++ b/src/vnet/tcp/tcp_output.c
@@ -1055,7 +1055,6 @@ tcp_send_fin (tcp_connection_t * tc)
u32 bi;
u8 fin_snt = 0;
-
if (PREDICT_FALSE (tcp_get_free_buffer_index (tm, &bi)))
return;
b = vlib_get_buffer (vm, bi);
@@ -1072,6 +1071,10 @@ tcp_send_fin (tcp_connection_t * tc)
tc->snd_una_max += 1;
tc->snd_nxt = tc->snd_una_max;
}
+ else
+ {
+ tc->snd_nxt = tc->snd_una_max;
+ }
tcp_retransmit_timer_force_update (tc);
TCP_EVT_DBG (TCP_EVT_FIN_SENT, tc);
}
@@ -1381,6 +1384,13 @@ tcp_timer_retransmit_handler_i (u32 index, u8 is_syn)
return;
}
+ /* Shouldn't be here */
+ if (tc->snd_una == tc->snd_una_max)
+ {
+ tcp_recovery_off (tc);
+ return;
+ }
+
/* We're not in recovery so make sure rto_boff is 0 */
if (!tcp_in_recovery (tc) && tc->rto_boff > 0)
{
@@ -1485,7 +1495,8 @@ tcp_timer_retransmit_handler_i (u32 index, u8 is_syn)
else
{
ASSERT (tc->state == TCP_STATE_CLOSED);
- TCP_DBG ("connection state: %d", tc->state);
+ if (CLIB_DEBUG)
+ TCP_DBG ("connection state: %U", format_tcp_connection, tc, 2);
return;
}
}