aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/sctp/sctp_input.c
diff options
context:
space:
mode:
authorMarco Varlese <marco.varlese@suse.com>2018-02-13 12:38:52 +0100
committerFlorin Coras <florin.coras@gmail.com>2018-02-15 07:31:01 +0000
commita38783e0d1ab1d4c661570a1ec90670a1fb0598d (patch)
tree0506e7820911191e9e80ceb0dd6172b3e7a888c8 /src/vnet/sctp/sctp_input.c
parent4941fcc23ab01f5ca918e56489d404b92d8bde90 (diff)
SCTP: refactoring
This patch takes care of some refactoring, including the initialization of the timestamp to calculate the RTO, the output state-machine validation which can be enabled (disabled by default) when debugging and some clean-up of unused fields. It also addresses the requirement of Karn's algorithm when computing the RTO. Change-Id: I6b875152369bff23cad085708cec1f7e1151cfa8 Signed-off-by: Marco Varlese <marco.varlese@suse.com>
Diffstat (limited to 'src/vnet/sctp/sctp_input.c')
-rw-r--r--src/vnet/sctp/sctp_input.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/vnet/sctp/sctp_input.c b/src/vnet/sctp/sctp_input.c
index 8df95642ce4..3f7ab4b8f8a 100644
--- a/src/vnet/sctp/sctp_input.c
+++ b/src/vnet/sctp/sctp_input.c
@@ -645,14 +645,14 @@ sctp_session_enqueue_data (sctp_connection_t * sctp_conn, vlib_buffer_t * b,
}
always_inline u8
-sctp_is_sack_delayable (sctp_connection_t * sctp_conn, u8 gapping)
+sctp_is_sack_delayable (sctp_connection_t * sctp_conn, u8 is_gapping)
{
- if (gapping != 0)
+ if (is_gapping != 0)
{
SCTP_CONN_TRACKING_DBG
("gapping != 0: CONN_INDEX = %u, sctp_conn->ack_state = %u",
sctp_conn->sub_conn[idx].connection.c_index, sctp_conn->ack_state);
- return 1;
+ return 0;
}
if (sctp_conn->ack_state >= MAX_ENQUEABLE_SACKS)
@@ -660,12 +660,12 @@ sctp_is_sack_delayable (sctp_connection_t * sctp_conn, u8 gapping)
SCTP_CONN_TRACKING_DBG
("sctp_conn->ack_state >= MAX_ENQUEABLE_SACKS: CONN_INDEX = %u, sctp_conn->ack_state = %u",
sctp_conn->sub_conn[idx].connection.c_index, sctp_conn->ack_state);
- return 1;
+ return 0;
}
sctp_conn->ack_state += 1;
- return 0;
+ return 1;
}
always_inline void
@@ -748,7 +748,7 @@ sctp_handle_data (sctp_payload_data_chunk_t * sctp_data_chunk,
SCTP_ADV_DBG ("POINTER_WITH_DATA = %p", b->data);
- if (sctp_is_sack_delayable (sctp_conn, is_gapping) != 0)
+ if (!sctp_is_sack_delayable (sctp_conn, is_gapping))
sctp_prepare_sack_chunk (sctp_conn, b);
return error;
@@ -1152,6 +1152,7 @@ sctp_handle_shutdown_ack (sctp_header_t * sctp_hdr,
*/
sctp_timer_reset (sctp_conn, MAIN_SCTP_SUB_CONN_IDX,
SCTP_TIMER_T2_SHUTDOWN);
+
sctp_send_shutdown_complete (sctp_conn);
*next0 = sctp_next_output (sctp_conn->sub_conn[idx].c_is_ip4);