diff options
author | Xin Long <lucien.xin@gmail.com> | 2017-11-25 08:05:36 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-11-27 10:38:45 -0500 |
commit | 52a395896a051a3d5c34fba67c324f69ec5e67c6 (patch) | |
tree | 43ba6d5322c022f3cc0477820f59d3017fbaf76a /net/sctp | |
parent | 159f2a7456c6ae95c1e1a58e8b8ec65ef12d51cf (diff) |
sctp: set sender next_tsn for the old result with ctsn_ack_point plus 1
When doing asoc reset, if the sender of the response has already sent some
chunk and increased asoc->next_tsn before the duplicate request comes, the
response will use the old result with an incorrect sender next_tsn.
Better than asoc->next_tsn, asoc->ctsn_ack_point can't be changed after
the sender of the response has performed the asoc reset and before the
peer has confirmed it, and it's value is still asoc->next_tsn original
value minus 1.
This patch sets sender next_tsn for the old result with ctsn_ack_point
plus 1 when processing the duplicate request, to make sure the sender
next_tsn value peer gets will be always right.
Fixes: 692787cef651 ("sctp: implement receiver-side procedures for the SSN/TSN Reset Request Parameter")
Signed-off-by: Xin Long <lucien.xin@gmail.com>
Acked-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sctp')
-rw-r--r-- | net/sctp/stream.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/sctp/stream.c b/net/sctp/stream.c index 9dd5bfe3860c..a20145b3a949 100644 --- a/net/sctp/stream.c +++ b/net/sctp/stream.c | |||
@@ -725,7 +725,7 @@ struct sctp_chunk *sctp_process_strreset_tsnreq( | |||
725 | i = asoc->strreset_inseq - request_seq - 1; | 725 | i = asoc->strreset_inseq - request_seq - 1; |
726 | result = asoc->strreset_result[i]; | 726 | result = asoc->strreset_result[i]; |
727 | if (result == SCTP_STRRESET_PERFORMED) { | 727 | if (result == SCTP_STRRESET_PERFORMED) { |
728 | next_tsn = asoc->next_tsn; | 728 | next_tsn = asoc->ctsn_ack_point + 1; |
729 | init_tsn = | 729 | init_tsn = |
730 | sctp_tsnmap_get_ctsn(&asoc->peer.tsn_map) + 1; | 730 | sctp_tsnmap_get_ctsn(&asoc->peer.tsn_map) + 1; |
731 | } | 731 | } |