From 9e09ff394ac0e731b5b33caf4d0cddff8de570b4 Mon Sep 17 00:00:00 2001 From: Marco Varlese Date: Mon, 5 Mar 2018 12:31:45 +0100 Subject: SCTP: retransmission in INIT/SHUTDOWN phase This patch addresses the need to handle timers timeouts (e.g. sent chunks not being acked) for both the INIT and SHUTDOWN phases. The INIT phase requires the handling of two timers the T1-init and T1-cookie timers whilst the SHUTDOWN phase requires the handling of the T2-shutdown timer only for the retransmission case. Left to be implemented is the handling of the DATA chunks retransmission (e.g. T3-rxtx expiration) but that will be submitted with a separate patch. Change-Id: I2b2e13dce11000aea3c7d965f02b27b76c97e605 Signed-off-by: Marco Varlese --- src/vnet/sctp/sctp.c | 34 +++++++++++++++++++++------------- 1 file changed, 21 insertions(+), 13 deletions(-) (limited to 'src/vnet/sctp/sctp.c') diff --git a/src/vnet/sctp/sctp.c b/src/vnet/sctp/sctp.c index df5d86094a5..0e086a1f072 100644 --- a/src/vnet/sctp/sctp.c +++ b/src/vnet/sctp/sctp.c @@ -680,19 +680,6 @@ sctp_expired_timers_cb (u32 conn_index, u32 timer_id) SCTP_DBG ("%s expired", sctp_timer_to_string (timer_id)); - switch (timer_id) - { - case SCTP_TIMER_T1_INIT: - case SCTP_TIMER_T1_COOKIE: - case SCTP_TIMER_T2_SHUTDOWN: - case SCTP_TIMER_T3_RXTX: - sctp_timer_reset (sctp_conn, conn_index, timer_id); - break; - case SCTP_TIMER_T4_HEARTBEAT: - sctp_timer_reset (sctp_conn, conn_index, timer_id); - goto heartbeat; - } - if (sctp_conn->sub_conn[conn_index].unacknowledged_hb > SCTP_PATH_MAX_RETRANS) { @@ -722,6 +709,27 @@ sctp_expired_timers_cb (u32 conn_index, u32 timer_id) sctp_connection_cleanup (sctp_conn); } + return; + } + + switch (timer_id) + { + case SCTP_TIMER_T1_INIT: + sctp_send_init (sctp_conn); + break; + case SCTP_TIMER_T1_COOKIE: + sctp_send_cookie_echo (sctp_conn); + break; + case SCTP_TIMER_T2_SHUTDOWN: + sctp_send_shutdown (sctp_conn); + break; + case SCTP_TIMER_T3_RXTX: + sctp_timer_reset (sctp_conn, conn_index, timer_id); + sctp_data_retransmit (sctp_conn); + break; + case SCTP_TIMER_T4_HEARTBEAT: + sctp_timer_reset (sctp_conn, conn_index, timer_id); + goto heartbeat; } return; -- cgit 1.2.3-korg