summaryrefslogtreecommitdiffstats
path: root/src/vnet/tcp
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2018-12-04 09:21:36 -0800
committerDave Barach <openvpp@barachs.net>2018-12-05 15:36:46 +0000
commit4af830cd7b4a11bb84840183f7eebd6fb43497a6 (patch)
tree3a47abfae6a651a4be8f5c6a6cb180399c90db62 /src/vnet/tcp
parent01fdbcca130a6575712de99e26f46e21da432d40 (diff)
session/tcp: postpone cleanup on reset
Change-Id: I45fd7538853f84c6c8bf804cc20acbc9601db3ba Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/vnet/tcp')
-rw-r--r--src/vnet/tcp/tcp.c8
-rw-r--r--src/vnet/tcp/tcp_input.c2
2 files changed, 8 insertions, 2 deletions
diff --git a/src/vnet/tcp/tcp.c b/src/vnet/tcp/tcp.c
index 04613cd6943..f703d634b54 100644
--- a/src/vnet/tcp/tcp.c
+++ b/src/vnet/tcp/tcp.c
@@ -296,6 +296,7 @@ tcp_connection_reset (tcp_connection_t * tc)
case TCP_STATE_CLOSED:
return;
}
+ tc->state = TCP_STATE_CLOSED;
}
/**
@@ -349,6 +350,9 @@ tcp_connection_close (tcp_connection_t * tc)
case TCP_STATE_FIN_WAIT_1:
tcp_timer_update (tc, TCP_TIMER_WAITCLOSE, TCP_2MSL_TIME);
break;
+ case TCP_STATE_CLOSED:
+ tcp_connection_timers_reset (tc);
+ break;
default:
TCP_DBG ("state: %u", tc->state);
}
@@ -553,6 +557,7 @@ tcp_init_snd_vars (tcp_connection_t * tc)
tc->snd_una = tc->iss;
tc->snd_nxt = tc->iss + 1;
tc->snd_una_max = tc->snd_nxt;
+ tc->srtt = 0;
}
void
@@ -1052,7 +1057,8 @@ tcp_snd_space_inline (tcp_connection_t * tc)
{
int snd_space, snt_limited;
- if (PREDICT_FALSE (tcp_in_fastrecovery (tc)))
+ if (PREDICT_FALSE (tcp_in_fastrecovery (tc)
+ || tc->state == TCP_STATE_CLOSED))
return 0;
snd_space = tcp_available_output_snd_space (tc);
diff --git a/src/vnet/tcp/tcp_input.c b/src/vnet/tcp/tcp_input.c
index 6809a9173df..e15ad73e2d1 100644
--- a/src/vnet/tcp/tcp_input.c
+++ b/src/vnet/tcp/tcp_input.c
@@ -501,8 +501,8 @@ tcp_estimate_initial_rtt (tcp_connection_t * tc)
else
{
mrtt = tcp_time_now_w_thread (thread_index) - tc->rcv_opts.tsecr;
+ mrtt = clib_max (mrtt, 1);
tc->mrtt_us = (f64) mrtt *TCP_TICK;
-
}
if (mrtt > 0 && mrtt < TCP_RTT_MAX)