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 3/5] sctp: only allow the asoc reset when the asoc outq is empty
Date: Mon, 27 Nov 2017 11:36:50 -0200 [thread overview]
Message-ID: <20171127133650.GJ3473@localhost.localdomain> (raw)
In-Reply-To: <49b01e67e4cc1f8a0be85ffefdee51dad6ae3286.1511614961.git.lucien.xin@gmail.com>
On Sat, Nov 25, 2017 at 09:05:34PM +0800, Xin Long wrote:
> As it says in rfc6525#section5.1.4, before sending the request,
>
> C2: The sender has either no outstanding TSNs or considers all
> outstanding TSNs abandoned.
>
> Prior to this patch, it tried to consider all outstanding TSNs abandoned
> by dropping all chunks in all outqs with sctp_outq_free (even including
> sacked, retransmit and transmitted queues) when doing this reset, which
> is too aggressive.
>
> To make it work gently, this patch will only allow the asoc reset when
> the sender has no outstanding TSNs by checking if unsent, transmitted
> and retransmit are all empty with sctp_outq_is_empty before sending
> and processing the request.
>
> 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 | 9 +++++++++
> 1 file changed, 9 insertions(+)
>
> diff --git a/net/sctp/stream.c b/net/sctp/stream.c
> index b209037..f3b7d27 100644
> --- a/net/sctp/stream.c
> +++ b/net/sctp/stream.c
> @@ -406,6 +406,9 @@ int sctp_send_reset_assoc(struct sctp_association *asoc)
> if (asoc->strreset_outstanding)
> return -EINPROGRESS;
>
> + if (!sctp_outq_is_empty(&asoc->outqueue))
> + return -EAGAIN;
> +
> chunk = sctp_make_strreset_tsnreq(asoc);
> if (!chunk)
> return -ENOMEM;
> @@ -728,6 +731,12 @@ struct sctp_chunk *sctp_process_strreset_tsnreq(
> }
> goto err;
> }
> +
> + if (!sctp_outq_is_empty(&asoc->outqueue)) {
> + result = SCTP_STRRESET_IN_PROGRESS;
> + goto err;
> + }
> +
> asoc->strreset_inseq++;
>
> if (!(asoc->strreset_enable & SCTP_ENABLE_RESET_ASSOC_REQ))
> --
> 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:36 UTC|newest]
Thread overview: 15+ 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 ` [PATCH net 1/5] sctp: use sizeof(__u16) for each stream number length instead of magic number 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 ` [PATCH net 3/5] sctp: only allow the asoc reset when the asoc " 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 ` [PATCH net 5/5] sctp: set sender next_tsn for the old result with ctsn_ack_point plus 1 Xin Long
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 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 13:36 ` Marcelo Ricardo Leitner [this message]
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 ` [PATCH net 1/5] sctp: use sizeof(__u16) for each stream number length instead of magic number 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 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=20171127133650.GJ3473@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).