* Setup retransmit and establish timers before requesting buffer
* such that we can return if we've ran out.
*/
- tcp_timer_set (tc, TCP_TIMER_ESTABLISH, TCP_ESTABLISH_TIME);
+ tcp_timer_set (tc, TCP_TIMER_ESTABLISH_AO, TCP_ESTABLISH_TIME);
tcp_timer_update (tc, TCP_TIMER_RETRANSMIT_SYN,
tc->rto * TCP_TO_TIMER_TICK);
{
/* Out of buffers so program fin retransmit ASAP */
tcp_timer_update (tc, TCP_TIMER_RETRANSMIT, 1);
- goto post_enqueue;
+ if (fin_snt)
+ tc->snd_nxt = tc->snd_una_max;
+ return;
}
tcp_retransmit_timer_force_update (tc);
tcp_enqueue_to_output_now (wrk, b, bi, tc->c_is_ip4);
TCP_EVT_DBG (TCP_EVT_FIN_SENT, tc);
-post_enqueue:
if (!fin_snt)
{
tc->flags |= TCP_CONN_FINSNT;
{
tc = tcp_connection_get (index, thread_index);
/* Note: the connection may have been closed and pool_put */
- if (PREDICT_FALSE (tc == 0 || tc->state < TCP_STATE_SYN_RCVD))
+ if (PREDICT_FALSE (tc == 0 || tc->state == TCP_STATE_SYN_SENT))
return;
tc->timers[TCP_TIMER_RETRANSMIT] = TCP_TIMER_HANDLE_INVALID;
+ /* Wait-close and retransmit could pop at the same time */
+ if (tc->state == TCP_STATE_CLOSED)
+ return;
}
if (tc->state >= TCP_STATE_ESTABLISHED)
/* Send one segment. Note that n_bytes may be zero due to buffer
* shortfall */
n_bytes = tcp_prepare_retransmit_segment (wrk, tc, 0, tc->snd_mss, &b);
-
- if (n_bytes == 0)
+ if (!n_bytes)
{
tcp_retransmit_timer_force_update (tc);
return;
if (tc->flags & TCP_CONN_HALF_OPEN_DONE)
{
if (tcp_half_open_connection_cleanup (tc))
- {
- clib_warning ("could not remove half-open connection");
- ASSERT (0);
- }
+ TCP_DBG ("could not remove half-open connection");
return;
}