aboutsummaryrefslogtreecommitdiffstats
path: root/net/sctp/sm_statefuns.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/sctp/sm_statefuns.c')
-rw-r--r--net/sctp/sm_statefuns.c23
1 files changed, 21 insertions, 2 deletions
diff --git a/net/sctp/sm_statefuns.c b/net/sctp/sm_statefuns.c
index 622284805500..0c9d5a6950fe 100644
--- a/net/sctp/sm_statefuns.c
+++ b/net/sctp/sm_statefuns.c
@@ -4138,6 +4138,24 @@ static sctp_disposition_t sctp_sf_abort_violation(
4138 goto nomem; 4138 goto nomem;
4139 4139
4140 if (asoc) { 4140 if (asoc) {
4141 /* Treat INIT-ACK as a special case during COOKIE-WAIT. */
4142 if (chunk->chunk_hdr->type == SCTP_CID_INIT_ACK &&
4143 !asoc->peer.i.init_tag) {
4144 sctp_initack_chunk_t *initack;
4145
4146 initack = (sctp_initack_chunk_t *)chunk->chunk_hdr;
4147 if (!sctp_chunk_length_valid(chunk,
4148 sizeof(sctp_initack_chunk_t)))
4149 abort->chunk_hdr->flags |= SCTP_CHUNK_FLAG_T;
4150 else {
4151 unsigned int inittag;
4152
4153 inittag = ntohl(initack->init_hdr.init_tag);
4154 sctp_add_cmd_sf(commands, SCTP_CMD_UPDATE_INITTAG,
4155 SCTP_U32(inittag));
4156 }
4157 }
4158
4141 sctp_add_cmd_sf(commands, SCTP_CMD_REPLY, SCTP_CHUNK(abort)); 4159 sctp_add_cmd_sf(commands, SCTP_CMD_REPLY, SCTP_CHUNK(abort));
4142 SCTP_INC_STATS(SCTP_MIB_OUTCTRLCHUNKS); 4160 SCTP_INC_STATS(SCTP_MIB_OUTCTRLCHUNKS);
4143 4161
@@ -4343,6 +4361,7 @@ sctp_disposition_t sctp_sf_do_prm_asoc(const struct sctp_endpoint *ep,
4343 sctp_cmd_seq_t *commands) 4361 sctp_cmd_seq_t *commands)
4344{ 4362{
4345 struct sctp_chunk *repl; 4363 struct sctp_chunk *repl;
4364 struct sctp_association* my_asoc;
4346 4365
4347 /* The comment below says that we enter COOKIE-WAIT AFTER 4366 /* The comment below says that we enter COOKIE-WAIT AFTER
4348 * sending the INIT, but that doesn't actually work in our 4367 * sending the INIT, but that doesn't actually work in our
@@ -4366,8 +4385,8 @@ sctp_disposition_t sctp_sf_do_prm_asoc(const struct sctp_endpoint *ep,
4366 /* Cast away the const modifier, as we want to just 4385 /* Cast away the const modifier, as we want to just
4367 * rerun it through as a sideffect. 4386 * rerun it through as a sideffect.
4368 */ 4387 */
4369 sctp_add_cmd_sf(commands, SCTP_CMD_NEW_ASOC, 4388 my_asoc = (struct sctp_association *)asoc;
4370 SCTP_ASOC((struct sctp_association *) asoc)); 4389 sctp_add_cmd_sf(commands, SCTP_CMD_NEW_ASOC, SCTP_ASOC(my_asoc));
4371 4390
4372 /* Choose transport for INIT. */ 4391 /* Choose transport for INIT. */
4373 sctp_add_cmd_sf(commands, SCTP_CMD_INIT_CHOOSE_TRANSPORT, 4392 sctp_add_cmd_sf(commands, SCTP_CMD_INIT_CHOOSE_TRANSPORT,