summaryrefslogtreecommitdiffstats
path: root/src/vnet/sctp/sctp_output.c
diff options
context:
space:
mode:
authorMarco Varlese <marco.varlese@suse.com>2018-03-12 12:36:59 +0100
committerFlorin Coras <florin.coras@gmail.com>2018-03-13 00:36:53 +0000
commit6e4d4a3684914d071a9b9249217bb6222aeb1d24 (patch)
tree2f36b37a03e356caa5a47cd1c6959b16d392569f /src/vnet/sctp/sctp_output.c
parent179ab361b78076bb3732d8c518c15f496a9373a5 (diff)
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 <marco.varlese@suse.com>
Diffstat (limited to 'src/vnet/sctp/sctp_output.c')
-rw-r--r--src/vnet/sctp/sctp_output.c9
1 files changed, 8 insertions, 1 deletions
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;