aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWei Yongjun <yjwei@cn.fujitsu.com>2007-08-30 22:03:58 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-09-26 01:55:46 -0400
commit02c4e12c6400b6dccdc6b5c2c18325551e4b2dc9 (patch)
tree4ccc1cb91ea5be4c2b1b299cff4a5914b9e92eb9
parenta09c83847b664dcd67a72613374061c900afb799 (diff)
SCTP: Send ABORT chunk with correct tag in response to INIT ACK
When SCTP client received an INIT ACK chunk with missing mandatory parameter such as "cookie parameter", it will send back a ABORT with T-bit not set and verification tag is set to 0. This is because before we accept this INIT ACK chunk, we do not know the peer's tag. This patch change to reflect vtag when responding to INIT ACK with missing mandatory parameter. Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com> Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com>
-rw-r--r--net/sctp/sm_statefuns.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/net/sctp/sm_statefuns.c b/net/sctp/sm_statefuns.c
index 177528ed3e1b..385f1757158a 100644
--- a/net/sctp/sm_statefuns.c
+++ b/net/sctp/sm_statefuns.c
@@ -5176,7 +5176,22 @@ static struct sctp_packet *sctp_ootb_pkt_new(const struct sctp_association *asoc
5176 * association exists, otherwise, use the peer's vtag. 5176 * association exists, otherwise, use the peer's vtag.
5177 */ 5177 */
5178 if (asoc) { 5178 if (asoc) {
5179 vtag = asoc->peer.i.init_tag; 5179 /* Special case the INIT-ACK as there is no peer's vtag
5180 * yet.
5181 */
5182 switch(chunk->chunk_hdr->type) {
5183 case SCTP_CID_INIT_ACK:
5184 {
5185 sctp_initack_chunk_t *initack;
5186
5187 initack = (sctp_initack_chunk_t *)chunk->chunk_hdr;
5188 vtag = ntohl(initack->init_hdr.init_tag);
5189 break;
5190 }
5191 default:
5192 vtag = asoc->peer.i.init_tag;
5193 break;
5194 }
5180 } else { 5195 } else {
5181 /* Special case the INIT and stale COOKIE_ECHO as there is no 5196 /* Special case the INIT and stale COOKIE_ECHO as there is no
5182 * vtag yet. 5197 * vtag yet.