summaryrefslogtreecommitdiffstats
path: root/src/vnet/tcp
diff options
context:
space:
mode:
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)