diff options
Diffstat (limited to 'net/sctp/sm_statefuns.c')
-rw-r--r-- | net/sctp/sm_statefuns.c | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/net/sctp/sm_statefuns.c b/net/sctp/sm_statefuns.c index aa51d190bfb2..fbbc9e6a3b78 100644 --- a/net/sctp/sm_statefuns.c +++ b/net/sctp/sm_statefuns.c | |||
@@ -440,7 +440,6 @@ sctp_disposition_t sctp_sf_do_5_1C_ack(const struct sctp_endpoint *ep, | |||
440 | { | 440 | { |
441 | struct sctp_chunk *chunk = arg; | 441 | struct sctp_chunk *chunk = arg; |
442 | sctp_init_chunk_t *initchunk; | 442 | sctp_init_chunk_t *initchunk; |
443 | __u32 init_tag; | ||
444 | struct sctp_chunk *err_chunk; | 443 | struct sctp_chunk *err_chunk; |
445 | struct sctp_packet *packet; | 444 | struct sctp_packet *packet; |
446 | sctp_error_t error; | 445 | sctp_error_t error; |
@@ -462,24 +461,6 @@ sctp_disposition_t sctp_sf_do_5_1C_ack(const struct sctp_endpoint *ep, | |||
462 | /* Grab the INIT header. */ | 461 | /* Grab the INIT header. */ |
463 | chunk->subh.init_hdr = (sctp_inithdr_t *) chunk->skb->data; | 462 | chunk->subh.init_hdr = (sctp_inithdr_t *) chunk->skb->data; |
464 | 463 | ||
465 | init_tag = ntohl(chunk->subh.init_hdr->init_tag); | ||
466 | |||
467 | /* Verification Tag: 3.3.3 | ||
468 | * If the value of the Initiate Tag in a received INIT ACK | ||
469 | * chunk is found to be 0, the receiver MUST treat it as an | ||
470 | * error and close the association by transmitting an ABORT. | ||
471 | */ | ||
472 | if (!init_tag) { | ||
473 | struct sctp_chunk *reply = sctp_make_abort(asoc, chunk, 0); | ||
474 | if (!reply) | ||
475 | goto nomem; | ||
476 | |||
477 | sctp_add_cmd_sf(commands, SCTP_CMD_REPLY, SCTP_CHUNK(reply)); | ||
478 | return sctp_stop_t1_and_abort(commands, SCTP_ERROR_INV_PARAM, | ||
479 | ECONNREFUSED, asoc, | ||
480 | chunk->transport); | ||
481 | } | ||
482 | |||
483 | /* Verify the INIT chunk before processing it. */ | 464 | /* Verify the INIT chunk before processing it. */ |
484 | err_chunk = NULL; | 465 | err_chunk = NULL; |
485 | if (!sctp_verify_init(asoc, chunk->chunk_hdr->type, | 466 | if (!sctp_verify_init(asoc, chunk->chunk_hdr->type, |
@@ -550,9 +531,6 @@ sctp_disposition_t sctp_sf_do_5_1C_ack(const struct sctp_endpoint *ep, | |||
550 | SCTP_CHUNK(err_chunk)); | 531 | SCTP_CHUNK(err_chunk)); |
551 | 532 | ||
552 | return SCTP_DISPOSITION_CONSUME; | 533 | return SCTP_DISPOSITION_CONSUME; |
553 | |||
554 | nomem: | ||
555 | return SCTP_DISPOSITION_NOMEM; | ||
556 | } | 534 | } |
557 | 535 | ||
558 | /* | 536 | /* |
@@ -1553,6 +1531,28 @@ sctp_disposition_t sctp_sf_do_5_2_2_dupinit(const struct sctp_endpoint *ep, | |||
1553 | } | 1531 | } |
1554 | 1532 | ||
1555 | 1533 | ||
1534 | /* | ||
1535 | * Unexpected INIT-ACK handler. | ||
1536 | * | ||
1537 | * Section 5.2.3 | ||
1538 | * If an INIT ACK received by an endpoint in any state other than the | ||
1539 | * COOKIE-WAIT state, the endpoint should discard the INIT ACK chunk. | ||
1540 | * An unexpected INIT ACK usually indicates the processing of an old or | ||
1541 | * duplicated INIT chunk. | ||
1542 | */ | ||
1543 | sctp_disposition_t sctp_sf_do_5_2_3_initack(const struct sctp_endpoint *ep, | ||
1544 | const struct sctp_association *asoc, | ||
1545 | const sctp_subtype_t type, | ||
1546 | void *arg, sctp_cmd_seq_t *commands) | ||
1547 | { | ||
1548 | /* Per the above section, we'll discard the chunk if we have an | ||
1549 | * endpoint. If this is an OOTB INIT-ACK, treat it as such. | ||
1550 | */ | ||
1551 | if (ep == sctp_sk((sctp_get_ctl_sock()))->ep) | ||
1552 | return sctp_sf_ootb(ep, asoc, type, arg, commands); | ||
1553 | else | ||
1554 | return sctp_sf_discard_chunk(ep, asoc, type, arg, commands); | ||
1555 | } | ||
1556 | 1556 | ||
1557 | /* Unexpected COOKIE-ECHO handler for peer restart (Table 2, action 'A') | 1557 | /* Unexpected COOKIE-ECHO handler for peer restart (Table 2, action 'A') |
1558 | * | 1558 | * |