summaryrefslogtreecommitdiffstats
path: root/src/vnet/tcp
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2018-12-05 11:19:14 -0800
committerDamjan Marion <dmarion@me.com>2018-12-07 15:08:58 +0000
commit311e11b179f1b4a8f8d3fb1ecce5919a3f146de8 (patch)
tree1069f97017c725976abe2b8bc055c5d358f17158 /src/vnet/tcp
parentb8dda5ffb6d357e085d4c2ca2d1f8e0828fc09c4 (diff)
tcp: validate connection state in retransmit
Change-Id: Ia9048bb4e074f7ebc36eb77e542a916924103332 Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/vnet/tcp')
-rw-r--r--src/vnet/tcp/tcp_output.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/vnet/tcp/tcp_output.c b/src/vnet/tcp/tcp_output.c
index 2f15268e7d6..0cf7fa95f8f 100644
--- a/src/vnet/tcp/tcp_output.c
+++ b/src/vnet/tcp/tcp_output.c
@@ -1515,7 +1515,7 @@ tcp_timer_retransmit_handler_i (u32 index, u8 is_syn)
{
tc = tcp_half_open_connection_get (index);
/* Note: the connection may have transitioned to ESTABLISHED... */
- if (PREDICT_FALSE (tc == 0))
+ if (PREDICT_FALSE (tc == 0 || tc->state != TCP_STATE_SYN_SENT))
return;
tc->timers[TCP_TIMER_RETRANSMIT_SYN] = TCP_TIMER_HANDLE_INVALID;
}
@@ -1523,7 +1523,7 @@ tcp_timer_retransmit_handler_i (u32 index, u8 is_syn)
{
tc = tcp_connection_get (index, thread_index);
/* Note: the connection may have been closed and pool_put */
- if (PREDICT_FALSE (tc == 0))
+ if (PREDICT_FALSE (tc == 0 || tc->state < TCP_STATE_SYN_RCVD))
return;
tc->timers[TCP_TIMER_RETRANSMIT] = TCP_TIMER_HANDLE_INVALID;
}