summaryrefslogtreecommitdiffstats
path: root/src/vnet/sctp/sctp.h
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.h
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.h')
-rw-r--r--src/vnet/sctp/sctp.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/vnet/sctp/sctp.h b/src/vnet/sctp/sctp.h
index 32d3ab96862..f0ce5949285 100644
--- a/src/vnet/sctp/sctp.h
+++ b/src/vnet/sctp/sctp.h
@@ -93,7 +93,9 @@ enum _sctp_subconn_state
{
SCTP_SUBCONN_STATE_DOWN = 0,
SCTP_SUBCONN_STATE_UP,
- SCTP_SUBCONN_STATE_ALLOW_HB
+ SCTP_SUBCONN_STATE_ALLOW_HB,
+ SCTP_SUBCONN_AWAITING_SACK,
+ SCTP_SUBCONN_SACK_RECEIVED
};
#define SCTP_INITIAL_SSHTRESH 65535
@@ -920,6 +922,8 @@ sctp_in_cong_recovery (sctp_connection_t * sctp_conn, u8 idx)
always_inline u8
cwnd_fully_utilized (sctp_connection_t * sctp_conn, u8 idx)
{
+ if (sctp_conn->sub_conn[idx].cwnd == 0)
+ return 1;
return 0;
}
@@ -928,6 +932,7 @@ always_inline void
update_cwnd (sctp_connection_t * sctp_conn)
{
u8 i;
+ u32 inflight = sctp_conn->next_tsn - sctp_conn->last_unacked_tsn;
for (i = 0; i < MAX_SCTP_CONNECTIONS; i++)
{
@@ -960,6 +965,12 @@ update_cwnd (sctp_connection_t * sctp_conn)
sctp_conn->sub_conn[i].cwnd =
clib_min (sctp_conn->sub_conn[i].PMTU, 1);
}
+
+ /* Section 6.1; point (D) */
+ if ((inflight + SCTP_RTO_BURST * sctp_conn->sub_conn[i].PMTU) <
+ sctp_conn->sub_conn[i].cwnd)
+ sctp_conn->sub_conn[i].cwnd =
+ inflight + SCTP_RTO_BURST * sctp_conn->sub_conn[i].PMTU;
}
}