From: Shan Wei <shanwei@cn.fujitsu.com>
To: Jiri Bohac <jbohac@suse.cz>
Cc: linux-sctp@vger.kernel.org, Neil Horman <nhorman@tuxdriver.com>,
Vlad Yasevich <vladislav.yasevich@hp.com>
Subject: Re: [PATCH][RFC] sctp: fix reporting of unknown parameters
Date: Fri, 18 Feb 2011 19:26:18 +0800 [thread overview]
Message-ID: <4D5E575A.9000905@cn.fujitsu.com> (raw)
In-Reply-To: <20110217231208.GA28281@midget.suse.cz>
(cc vlad Yasevich)
Jiri Bohac wrote, at 02/18/2011 07:12 AM:
> Hi,
>
> commit 5fa782c2f5ef6c2e4f04d3e228412c9b4a4c8809 re-worked the
> handling of unknown parameters. sctp_init_cause_fixed() can now
> return -ENOSPC if there is not enough tailroom in the error
> chunk skb. When this happens, the error header is not appended to
> the error chunk. In that case, the payload of the unknown parameter
> should not be appended either.
>
> Signed-off-by: Jiri Bohac <jbohac@suse.cz>
For this case, there is no more tailroom in skb, originally
we send incomplete INIT-ACK chunk. With your patch, this chunk also
can't info the sender of INIT Chunk which parameter is not unrecognized.
So maybe this handle is not perfect.
So, for this case, i think send ABORT is more appropriate.
Just take same handle with SCTP_IERROR_NOMEM
>
>
> diff --git a/net/sctp/sm_make_chunk.c b/net/sctp/sm_make_chunk.c
> index 2cc46f0..b23428f 100644
> --- a/net/sctp/sm_make_chunk.c
> +++ b/net/sctp/sm_make_chunk.c
> @@ -2029,11 +2029,11 @@ static sctp_ierror_t sctp_process_unk_param(const struct sctp_association *asoc,
> *errp = sctp_make_op_error_fixed(asoc, chunk);
>
> if (*errp) {
> - sctp_init_cause_fixed(*errp, SCTP_ERROR_UNKNOWN_PARAM,
> - WORD_ROUND(ntohs(param.p->length)));
> - sctp_addto_chunk_fixed(*errp,
> - WORD_ROUND(ntohs(param.p->length)),
> - param.v);
> + if (!sctp_init_cause_fixed(*errp, SCTP_ERROR_UNKNOWN_PARAM,
> + WORD_ROUND(ntohs(param.p->length))))
> + sctp_addto_chunk_fixed(*errp,
> + WORD_ROUND(ntohs(param.p->length)),
> + param.v);
> } else {
> /* If there is no memory for generating the ERROR
> * report as specified, an ABORT will be triggered
>
>
--
Best Regards
-----
Shan Wei
next prev parent reply other threads:[~2011-02-18 16:25 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-17 23:12 [PATCH][RFC] sctp: fix reporting of unknown parameters Jiri Bohac
2011-02-18 11:26 ` Shan Wei [this message]
2011-02-18 12:01 ` Jiri Bohac
2011-02-18 14:43 ` Vladislav Yasevich
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=4D5E575A.9000905@cn.fujitsu.com \
--to=shanwei@cn.fujitsu.com \
--cc=jbohac@suse.cz \
--cc=linux-sctp@vger.kernel.org \
--cc=nhorman@tuxdriver.com \
--cc=vladislav.yasevich@hp.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).