tcp: close session on retransmit failure
[vpp.git] / src / vnet / tcp / tcp_output.c
index 4298611..64e3b1a 100644 (file)
@@ -1518,6 +1518,7 @@ tcp_timer_retransmit_handler (u32 tc_index)
          tcp_send_reset (tc);
          tcp_connection_set_state (tc, TCP_STATE_CLOSED);
          session_transport_closing_notify (&tc->connection);
+         session_transport_closed_notify (&tc->connection);
          tcp_connection_timers_reset (tc);
          tcp_timer_update (tc, TCP_TIMER_WAITCLOSE, tcp_cfg.closewait_time);
          return;
@@ -1850,6 +1851,9 @@ tcp_retransmit_should_retry_head (tcp_connection_t * tc,
   u32 tx_adv_sack = sb->high_sacked - tc->snd_congestion;
   f64 rr = (f64) tc->ssthresh / tc->prev_cwnd;
 
+  if (tcp_fastrecovery_first (tc))
+    return 1;
+
   return (tx_adv_sack > (tc->snd_una - tc->prr_start) * rr);
 }
 
@@ -1928,6 +1932,8 @@ tcp_retransmit_sack (tcp_worker_ctx_t * wrk, tcp_connection_t * tc,
       ASSERT (tc->rxt_delivered <= tc->snd_rxt_bytes);
     }
 
+  tcp_fastrecovery_first_off (tc);
+
   TCP_EVT (TCP_EVT_CC_EVT, tc, 0);
   hole = scoreboard_get_hole (sb, sb->cur_rxt_hole);