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 <marco.varlese@suse.com>
diff --git a/src/vnet/sctp/sctp.c b/src/vnet/sctp/sctp.c
index df5d860..0e086a1 100644
--- a/src/vnet/sctp/sctp.c
+++ b/src/vnet/sctp/sctp.c
@@ -680,19 +680,6 @@
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_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;