From: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
To: Xin Long <lucien.xin@gmail.com>
Cc: network dev <netdev@vger.kernel.org>,
linux-sctp@vger.kernel.org, davem@davemloft.net,
Neil Horman <nhorman@tuxdriver.com>
Subject: Re: [PATCH net 5/5] sctp: set sender next_tsn for the old result with ctsn_ack_point plus 1
Date: Mon, 27 Nov 2017 13:37:11 +0000 [thread overview]
Message-ID: <20171127133711.GL3473@localhost.localdomain> (raw)
In-Reply-To: <380acfa72f7260cccf9fc9ffb2db81d4234fd38a.1511614961.git.lucien.xin@gmail.com>
On Sat, Nov 25, 2017 at 09:05:36PM +0800, Xin Long wrote:
> 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>
> ---
> net/sctp/stream.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/net/sctp/stream.c b/net/sctp/stream.c
> index 9dd5bfe..a20145b 100644
> --- a/net/sctp/stream.c
> +++ b/net/sctp/stream.c
> @@ -725,7 +725,7 @@ struct sctp_chunk *sctp_process_strreset_tsnreq(
> i = asoc->strreset_inseq - request_seq - 1;
> result = asoc->strreset_result[i];
> if (result = SCTP_STRRESET_PERFORMED) {
> - next_tsn = asoc->next_tsn;
> + next_tsn = asoc->ctsn_ack_point + 1;
> init_tsn > sctp_tsnmap_get_ctsn(&asoc->peer.tsn_map) + 1;
> }
> --
> 2.1.0
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-sctp" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
WARNING: multiple messages have this Message-ID (diff)
From: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
To: Xin Long <lucien.xin@gmail.com>
Cc: network dev <netdev@vger.kernel.org>,
linux-sctp@vger.kernel.org, davem@davemloft.net,
Neil Horman <nhorman@tuxdriver.com>
Subject: Re: [PATCH net 5/5] sctp: set sender next_tsn for the old result with ctsn_ack_point plus 1
Date: Mon, 27 Nov 2017 11:37:11 -0200 [thread overview]
Message-ID: <20171127133711.GL3473@localhost.localdomain> (raw)
In-Reply-To: <380acfa72f7260cccf9fc9ffb2db81d4234fd38a.1511614961.git.lucien.xin@gmail.com>
On Sat, Nov 25, 2017 at 09:05:36PM +0800, Xin Long wrote:
> 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>
> ---
> net/sctp/stream.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/net/sctp/stream.c b/net/sctp/stream.c
> index 9dd5bfe..a20145b 100644
> --- a/net/sctp/stream.c
> +++ b/net/sctp/stream.c
> @@ -725,7 +725,7 @@ struct sctp_chunk *sctp_process_strreset_tsnreq(
> i = asoc->strreset_inseq - request_seq - 1;
> result = asoc->strreset_result[i];
> if (result == SCTP_STRRESET_PERFORMED) {
> - next_tsn = asoc->next_tsn;
> + next_tsn = asoc->ctsn_ack_point + 1;
> init_tsn =
> sctp_tsnmap_get_ctsn(&asoc->peer.tsn_map) + 1;
> }
> --
> 2.1.0
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-sctp" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
next prev parent reply other threads:[~2017-11-27 13:37 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-25 13:05 [PATCH net 0/5] sctp: a bunch of fixes for stream reconfig Xin Long
2017-11-25 13:05 ` Xin Long
2017-11-25 13:05 ` [PATCH net 1/5] sctp: use sizeof(__u16) for each stream number length instead of magic number Xin Long
2017-11-25 13:05 ` Xin Long
2017-11-25 13:05 ` [PATCH net 2/5] sctp: only allow the out stream reset when the stream outq is empty Xin Long
2017-11-25 13:05 ` Xin Long
2017-11-25 13:05 ` [PATCH net 3/5] sctp: only allow the asoc reset when the asoc " Xin Long
2017-11-25 13:05 ` Xin Long
2017-11-25 13:05 ` [PATCH net 4/5] sctp: avoid flushing unsent queue when doing asoc reset Xin Long
2017-11-25 13:05 ` Xin Long
2017-11-25 13:05 ` [PATCH net 5/5] sctp: set sender next_tsn for the old result with ctsn_ack_point plus 1 Xin Long
2017-11-25 13:05 ` Xin Long
2017-11-27 13:37 ` Marcelo Ricardo Leitner [this message]
2017-11-27 13:37 ` Marcelo Ricardo Leitner
2017-11-27 13:37 ` [PATCH net 4/5] sctp: avoid flushing unsent queue when doing asoc reset Marcelo Ricardo Leitner
2017-11-27 13:37 ` Marcelo Ricardo Leitner
2017-11-27 10:06 ` [PATCH net 3/5] sctp: only allow the asoc reset when the asoc outq is empty David Laight
2017-11-27 10:58 ` Xin Long
2017-11-27 10:58 ` Xin Long
2017-11-27 13:36 ` Marcelo Ricardo Leitner
2017-11-27 13:36 ` Marcelo Ricardo Leitner
2017-11-27 13:36 ` [PATCH net 2/5] sctp: only allow the out stream reset when the stream " Marcelo Ricardo Leitner
2017-11-27 13:36 ` Marcelo Ricardo Leitner
2017-11-27 13:36 ` [PATCH net 1/5] sctp: use sizeof(__u16) for each stream number length instead of magic number Marcelo Ricardo Leitner
2017-11-27 13:36 ` Marcelo Ricardo Leitner
2017-11-27 13:56 ` [PATCH net 0/5] sctp: a bunch of fixes for stream reconfig Neil Horman
2017-11-27 13:56 ` Neil Horman
2017-11-27 15:43 ` David Miller
2017-11-27 15:43 ` David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20171127133711.GL3473@localhost.localdomain \
--to=marcelo.leitner@gmail.com \
--cc=davem@davemloft.net \
--cc=linux-sctp@vger.kernel.org \
--cc=lucien.xin@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=nhorman@tuxdriver.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.