summaryrefslogtreecommitdiffstats
path: root/src/vnet/sctp/sctp.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.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.c')
-rw-r--r--src/vnet/sctp/sctp.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/vnet/sctp/sctp.c b/src/vnet/sctp/sctp.c
index 42cc2acae91..76a1bf41eeb 100644
--- a/src/vnet/sctp/sctp.c
+++ b/src/vnet/sctp/sctp.c
@@ -615,14 +615,21 @@ sctp_session_send_mss (transport_connection_t * trans_conn)
update_cwnd (sctp_conn);
update_smallest_pmtu_idx (sctp_conn);
- return sctp_conn->sub_conn[sctp_conn->smallest_PMTU_idx].cwnd;
+ u8 idx = sctp_data_subconn_select (sctp_conn);
+
+ return sctp_conn->sub_conn[idx].cwnd;
}
u16
sctp_snd_space (sctp_connection_t * sctp_conn)
{
+ /* RFC 4096 Section 6.1; point (A) */
+ if (sctp_conn->peer_rwnd == 0)
+ return 0;
+
+ u8 idx = sctp_data_subconn_select (sctp_conn);
/* Finally, let's subtract the DATA chunk headers overhead */
- return sctp_conn->sub_conn[sctp_conn->smallest_PMTU_idx].cwnd -
+ return sctp_conn->sub_conn[idx].cwnd -
sizeof (sctp_payload_data_chunk_t) - sizeof (sctp_full_hdr_t);
}