From 6e4d4a3684914d071a9b9249217bb6222aeb1d24 Mon Sep 17 00:00:00 2001 From: Marco Varlese Date: Mon, 12 Mar 2018 12:36:59 +0100 Subject: SCTP: cumulative SACK fix A bug was found affecting the cumulative sending of SACK messages. Because the next0 was never assigned to the next_output the SACK message was never leaving the peer. Further, two new flags have been added to distinguish when a peer is AWAITING a SACK message (e.g. DATA is inflight and waiting to be acknowledged). Change-Id: Ibb5a98f7e5fed15cdc76710b74195cac031d59ed Signed-off-by: Marco Varlese --- src/vnet/sctp/sctp_output.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/vnet/sctp/sctp_output.c') diff --git a/src/vnet/sctp/sctp_output.c b/src/vnet/sctp/sctp_output.c index a4ba960789e..9ac3feb8aab 100644 --- a/src/vnet/sctp/sctp_output.c +++ b/src/vnet/sctp/sctp_output.c @@ -463,6 +463,8 @@ sctp_prepare_init_chunk (sctp_connection_t * sctp_conn, u8 idx, vnet_sctp_set_chunk_length (&init_chunk->chunk_hdr, chunk_len); vnet_sctp_common_hdr_params_host_to_net (&init_chunk->chunk_hdr); + sctp_init_cwnd (sctp_conn); + init_chunk->a_rwnd = clib_host_to_net_u32 (sctp_conn->sub_conn[idx].cwnd); init_chunk->initiate_tag = clib_host_to_net_u32 (random_u32 (&random_seed)); init_chunk->inboud_streams_count = @@ -1405,7 +1407,12 @@ sctp_push_hdr_i (sctp_connection_t * sctp_conn, vlib_buffer_t * b, SCTP_ADV_DBG_OUTPUT ("POINTER_WITH_DATA = %p, DATA_OFFSET = %u", b->data, b->current_data); - sctp_conn->last_unacked_tsn = sctp_conn->next_tsn; + if (sctp_conn->sub_conn[idx].state != SCTP_SUBCONN_AWAITING_SACK) + { + sctp_conn->sub_conn[idx].state = SCTP_SUBCONN_AWAITING_SACK; + sctp_conn->last_unacked_tsn = sctp_conn->next_tsn; + } + sctp_conn->next_tsn += data_len; u32 inflight = sctp_conn->next_tsn - sctp_conn->last_unacked_tsn; -- cgit 1.2.3-korg