aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Tuexen <tuexen@FreeBSD.org>2020-05-07 03:48:59 +0000
committerMichael Tuexen <tuexen@FreeBSD.org>2020-05-07 03:48:59 +0000
commit51dc5f2d1a45367c2dd8aa1ea12fd82072170fea (patch)
treef50c8f2b37efd008c3eda039fbb0b1e8aa29ed67
parentaf5fc8730c1fc5c416d737452cd7cd213b93868e (diff)
downloadsrc-51dc5f2d1a45367c2dd8aa1ea12fd82072170fea.tar.gz
src-51dc5f2d1a45367c2dd8aa1ea12fd82072170fea.zip
MFC r360662: Fix a bug in SCTP SACK generation
Fix the computation of the numbers of entries of the mapping array to look at when generating a SACK. This was wrong in case of sequence numbers wrap arounds. Thanks to Gwenael FOURRE for reporting the issue for the userland stack: https://github.com/sctplab/usrsctp/issues/462
Notes
Notes: svn path=/stable/11/; revision=360771
-rw-r--r--sys/netinet/sctp_output.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/netinet/sctp_output.c b/sys/netinet/sctp_output.c
index 10ce1f6af036..1001a1933961 100644
--- a/sys/netinet/sctp_output.c
+++ b/sys/netinet/sctp_output.c
@@ -10713,7 +10713,7 @@ sctp_send_sack(struct sctp_tcb *stcb, int so_locked
if (highest_tsn > asoc->mapping_array_base_tsn) {
siz = (((highest_tsn - asoc->mapping_array_base_tsn) + 1) + 7) / 8;
} else {
- siz = (((MAX_TSN - highest_tsn) + 1) + highest_tsn + 7) / 8;
+ siz = (((MAX_TSN - asoc->mapping_array_base_tsn) + 1) + highest_tsn + 7) / 8;
}
} else {
sack = NULL;