All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wei Yongjun <yjwei@cn.fujitsu.com>
To: linux-sctp@vger.kernel.org
Subject: [PATCH] sctp: fix the format of invalid mandatory parameter format
Date: Wed, 15 Apr 2009 08:08:50 +0000	[thread overview]
Message-ID: <49E59612.70504@cn.fujitsu.com> (raw)

RFC 4960 defined the format of invalid mandatory parameter:

   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |     Cause Code=7              |      Cause Length=4           |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

But invalid mandatory parameter sent in ASCONF-ACK chunk include the
invalid paramter complete with TLV.

Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com>
---
 net/sctp/sm_make_chunk.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/sctp/sm_make_chunk.c b/net/sctp/sm_make_chunk.c
index 6851ee9..46de41a 100644
--- a/net/sctp/sm_make_chunk.c
+++ b/net/sctp/sm_make_chunk.c
@@ -2822,7 +2822,7 @@ static void sctp_add_asconf_response(struct sctp_chunk *chunk, __be32 crr_id,
 	} else {
 		response_type = SCTP_PARAM_ERR_CAUSE;
 		err_param_len = sizeof(err_param);
-		if (asconf_param)
+		if (asconf_param && err_code != SCTP_ERROR_INV_PARAM)
 			asconf_param_len  				 ntohs(asconf_param->param_hdr.length);
 	}
@@ -2844,7 +2844,7 @@ static void sctp_add_asconf_response(struct sctp_chunk *chunk, __be32 crr_id,
 	sctp_addto_chunk(chunk, err_param_len, &err_param);
 
 	/* Add the failed TLV copied from ASCONF chunk. */
-	if (asconf_param)
+	if (asconf_param && err_code != SCTP_ERROR_INV_PARAM)
 		sctp_addto_chunk(chunk, asconf_param_len, asconf_param);
 }
 
-- 
1.5.3.8





             reply	other threads:[~2009-04-15  8:08 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-15  8:08 Wei Yongjun [this message]
2009-04-15 13:17 ` [PATCH] sctp: fix the format of invalid mandatory parameter format Vlad 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=49E59612.70504@cn.fujitsu.com \
    --to=yjwei@cn.fujitsu.com \
    --cc=linux-sctp@vger.kernel.org \
    /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.