aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/tcp/tcp.c
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2019-07-22 20:55:11 -0700
committerDave Barach <openvpp@barachs.net>2019-07-23 14:56:50 +0000
commita0904f0e3f15873d01e2d5bc53d321a70412d5f4 (patch)
treea7947fc72798c8b8b3c7943969f9d526ecd46206 /src/vnet/tcp/tcp.c
parent8adb92be294a10dbdb5cfd374420d74621c57b8f (diff)
tcp: generate closed notifications whenever tcp closes
Type: fix This gives the session layer a chance to to cleanup events. Change-Id: I7499e94acf06340e2b19a1d91a4c61a63cd66c52 Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/vnet/tcp/tcp.c')
-rw-r--r--src/vnet/tcp/tcp.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/vnet/tcp/tcp.c b/src/vnet/tcp/tcp.c
index 79741907337..f0d6478df18 100644
--- a/src/vnet/tcp/tcp.c
+++ b/src/vnet/tcp/tcp.c
@@ -347,6 +347,7 @@ tcp_connection_reset (tcp_connection_t * tc)
tcp_timer_set (tc, TCP_TIMER_WAITCLOSE, TCP_CLOSEWAIT_TIME);
session_transport_reset_notify (&tc->connection);
tcp_connection_set_state (tc, TCP_STATE_CLOSED);
+ session_transport_closed_notify (&tc->connection);
break;
case TCP_STATE_CLOSE_WAIT:
case TCP_STATE_FIN_WAIT_1:
@@ -359,6 +360,7 @@ tcp_connection_reset (tcp_connection_t * tc)
* be still trying to send data */
session_transport_closed_notify (&tc->connection);
tcp_connection_set_state (tc, TCP_STATE_CLOSED);
+ session_transport_closed_notify (&tc->connection);
break;
case TCP_STATE_CLOSED:
case TCP_STATE_TIME_WAIT:
@@ -408,6 +410,7 @@ tcp_connection_close (tcp_connection_t * tc)
tcp_connection_timers_reset (tc);
tcp_connection_set_state (tc, TCP_STATE_CLOSED);
tcp_timer_set (tc, TCP_TIMER_WAITCLOSE, TCP_CLOSEWAIT_TIME);
+ session_transport_closed_notify (&tc->connection);
break;
}
if (!transport_max_tx_dequeue (&tc->connection))
@@ -1351,12 +1354,12 @@ tcp_timer_waitclose_handler (u32 conn_index)
break;
case TCP_STATE_FIN_WAIT_1:
tcp_connection_timers_reset (tc);
+ session_transport_closed_notify (&tc->connection);
if (tc->flags & TCP_CONN_FINPNDG)
{
/* If FIN pending, we haven't sent everything, but we did try.
* Notify session layer that transport is closed. */
tcp_connection_set_state (tc, TCP_STATE_CLOSED);
- session_transport_closed_notify (&tc->connection);
tcp_send_reset (tc);
tcp_timer_set (tc, TCP_TIMER_WAITCLOSE, TCP_CLEANUP_TIME);
}