diff options
author | Russell King <rmk@dyn-67.arm.linux.org.uk> | 2008-10-15 18:16:07 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2008-10-15 18:16:07 -0400 |
commit | 2502991560dc8244dbe10e48473d85722c1e2ec1 (patch) | |
tree | 63b1f3be2ed56ff06f1e8db709e4ce85d69c3add /net/sctp/sm_statefuns.c | |
parent | 7e69a8c4d06b7ecb874f571e82b715a9f79bc3c4 (diff) | |
parent | a9ff8f6462635c8d9f8d64b7b10ddcea8404d77b (diff) |
Merge branch 'fixes' into for-linus
Conflicts:
arch/arm/mach-versatile/core.c
Diffstat (limited to 'net/sctp/sm_statefuns.c')
-rw-r--r-- | net/sctp/sm_statefuns.c | 50 |
1 files changed, 24 insertions, 26 deletions
diff --git a/net/sctp/sm_statefuns.c b/net/sctp/sm_statefuns.c index 7c622af2ce55..d4c3fbc4671e 100644 --- a/net/sctp/sm_statefuns.c +++ b/net/sctp/sm_statefuns.c | |||
@@ -315,8 +315,10 @@ sctp_disposition_t sctp_sf_do_5_1B_init(const struct sctp_endpoint *ep, | |||
315 | /* If the packet is an OOTB packet which is temporarily on the | 315 | /* If the packet is an OOTB packet which is temporarily on the |
316 | * control endpoint, respond with an ABORT. | 316 | * control endpoint, respond with an ABORT. |
317 | */ | 317 | */ |
318 | if (ep == sctp_sk((sctp_get_ctl_sock()))->ep) | 318 | if (ep == sctp_sk((sctp_get_ctl_sock()))->ep) { |
319 | SCTP_INC_STATS(SCTP_MIB_OUTOFBLUES); | ||
319 | return sctp_sf_tabort_8_4_8(ep, asoc, type, arg, commands); | 320 | return sctp_sf_tabort_8_4_8(ep, asoc, type, arg, commands); |
321 | } | ||
320 | 322 | ||
321 | /* 3.1 A packet containing an INIT chunk MUST have a zero Verification | 323 | /* 3.1 A packet containing an INIT chunk MUST have a zero Verification |
322 | * Tag. | 324 | * Tag. |
@@ -635,8 +637,10 @@ sctp_disposition_t sctp_sf_do_5_1D_ce(const struct sctp_endpoint *ep, | |||
635 | /* If the packet is an OOTB packet which is temporarily on the | 637 | /* If the packet is an OOTB packet which is temporarily on the |
636 | * control endpoint, respond with an ABORT. | 638 | * control endpoint, respond with an ABORT. |
637 | */ | 639 | */ |
638 | if (ep == sctp_sk((sctp_get_ctl_sock()))->ep) | 640 | if (ep == sctp_sk((sctp_get_ctl_sock()))->ep) { |
641 | SCTP_INC_STATS(SCTP_MIB_OUTOFBLUES); | ||
639 | return sctp_sf_tabort_8_4_8(ep, asoc, type, arg, commands); | 642 | return sctp_sf_tabort_8_4_8(ep, asoc, type, arg, commands); |
643 | } | ||
640 | 644 | ||
641 | /* Make sure that the COOKIE_ECHO chunk has a valid length. | 645 | /* Make sure that the COOKIE_ECHO chunk has a valid length. |
642 | * In this case, we check that we have enough for at least a | 646 | * In this case, we check that we have enough for at least a |
@@ -2076,10 +2080,6 @@ sctp_disposition_t sctp_sf_shutdown_pending_abort( | |||
2076 | sctp_bind_addr_state(&asoc->base.bind_addr, &chunk->dest)) | 2080 | sctp_bind_addr_state(&asoc->base.bind_addr, &chunk->dest)) |
2077 | return sctp_sf_discard_chunk(ep, asoc, type, arg, commands); | 2081 | return sctp_sf_discard_chunk(ep, asoc, type, arg, commands); |
2078 | 2082 | ||
2079 | /* Stop the T5-shutdown guard timer. */ | ||
2080 | sctp_add_cmd_sf(commands, SCTP_CMD_TIMER_STOP, | ||
2081 | SCTP_TO(SCTP_EVENT_TIMEOUT_T5_SHUTDOWN_GUARD)); | ||
2082 | |||
2083 | return __sctp_sf_do_9_1_abort(ep, asoc, type, arg, commands); | 2083 | return __sctp_sf_do_9_1_abort(ep, asoc, type, arg, commands); |
2084 | } | 2084 | } |
2085 | 2085 | ||
@@ -3382,6 +3382,8 @@ sctp_disposition_t sctp_sf_do_8_5_1_E_sa(const struct sctp_endpoint *ep, | |||
3382 | * packet and the state function that handles OOTB SHUTDOWN_ACK is | 3382 | * packet and the state function that handles OOTB SHUTDOWN_ACK is |
3383 | * called with a NULL association. | 3383 | * called with a NULL association. |
3384 | */ | 3384 | */ |
3385 | SCTP_INC_STATS(SCTP_MIB_OUTOFBLUES); | ||
3386 | |||
3385 | return sctp_sf_shut_8_4_5(ep, NULL, type, arg, commands); | 3387 | return sctp_sf_shut_8_4_5(ep, NULL, type, arg, commands); |
3386 | } | 3388 | } |
3387 | 3389 | ||
@@ -4186,11 +4188,10 @@ static sctp_disposition_t sctp_sf_abort_violation( | |||
4186 | SCTP_INC_STATS(SCTP_MIB_OUTCTRLCHUNKS); | 4188 | SCTP_INC_STATS(SCTP_MIB_OUTCTRLCHUNKS); |
4187 | } | 4189 | } |
4188 | 4190 | ||
4189 | discard: | ||
4190 | sctp_sf_pdiscard(ep, asoc, SCTP_ST_CHUNK(0), arg, commands); | ||
4191 | |||
4192 | SCTP_INC_STATS(SCTP_MIB_ABORTEDS); | 4191 | SCTP_INC_STATS(SCTP_MIB_ABORTEDS); |
4193 | 4192 | ||
4193 | discard: | ||
4194 | sctp_sf_pdiscard(ep, asoc, SCTP_ST_CHUNK(0), arg, commands); | ||
4194 | return SCTP_DISPOSITION_ABORT; | 4195 | return SCTP_DISPOSITION_ABORT; |
4195 | 4196 | ||
4196 | nomem_pkt: | 4197 | nomem_pkt: |
@@ -4263,12 +4264,10 @@ static sctp_disposition_t sctp_sf_violation_paramlen( | |||
4263 | sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED, | 4264 | sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED, |
4264 | SCTP_PERR(SCTP_ERROR_PROTO_VIOLATION)); | 4265 | SCTP_PERR(SCTP_ERROR_PROTO_VIOLATION)); |
4265 | SCTP_DEC_STATS(SCTP_MIB_CURRESTAB); | 4266 | SCTP_DEC_STATS(SCTP_MIB_CURRESTAB); |
4267 | SCTP_INC_STATS(SCTP_MIB_ABORTEDS); | ||
4266 | 4268 | ||
4267 | discard: | 4269 | discard: |
4268 | sctp_sf_pdiscard(ep, asoc, SCTP_ST_CHUNK(0), arg, commands); | 4270 | sctp_sf_pdiscard(ep, asoc, SCTP_ST_CHUNK(0), arg, commands); |
4269 | |||
4270 | SCTP_INC_STATS(SCTP_MIB_ABORTEDS); | ||
4271 | |||
4272 | return SCTP_DISPOSITION_ABORT; | 4271 | return SCTP_DISPOSITION_ABORT; |
4273 | nomem: | 4272 | nomem: |
4274 | return SCTP_DISPOSITION_NOMEM; | 4273 | return SCTP_DISPOSITION_NOMEM; |
@@ -4543,13 +4542,6 @@ sctp_disposition_t sctp_sf_do_9_2_prm_shutdown( | |||
4543 | sctp_add_cmd_sf(commands, SCTP_CMD_NEW_STATE, | 4542 | sctp_add_cmd_sf(commands, SCTP_CMD_NEW_STATE, |
4544 | SCTP_STATE(SCTP_STATE_SHUTDOWN_PENDING)); | 4543 | SCTP_STATE(SCTP_STATE_SHUTDOWN_PENDING)); |
4545 | 4544 | ||
4546 | /* sctpimpguide-05 Section 2.12.2 | ||
4547 | * The sender of the SHUTDOWN MAY also start an overall guard timer | ||
4548 | * 'T5-shutdown-guard' to bound the overall time for shutdown sequence. | ||
4549 | */ | ||
4550 | sctp_add_cmd_sf(commands, SCTP_CMD_TIMER_START, | ||
4551 | SCTP_TO(SCTP_EVENT_TIMEOUT_T5_SHUTDOWN_GUARD)); | ||
4552 | |||
4553 | disposition = SCTP_DISPOSITION_CONSUME; | 4545 | disposition = SCTP_DISPOSITION_CONSUME; |
4554 | if (sctp_outq_is_empty(&asoc->outqueue)) { | 4546 | if (sctp_outq_is_empty(&asoc->outqueue)) { |
4555 | disposition = sctp_sf_do_9_2_start_shutdown(ep, asoc, type, | 4547 | disposition = sctp_sf_do_9_2_start_shutdown(ep, asoc, type, |
@@ -4994,6 +4986,13 @@ sctp_disposition_t sctp_sf_do_9_2_start_shutdown( | |||
4994 | sctp_add_cmd_sf(commands, SCTP_CMD_TIMER_START, | 4986 | sctp_add_cmd_sf(commands, SCTP_CMD_TIMER_START, |
4995 | SCTP_TO(SCTP_EVENT_TIMEOUT_T2_SHUTDOWN)); | 4987 | SCTP_TO(SCTP_EVENT_TIMEOUT_T2_SHUTDOWN)); |
4996 | 4988 | ||
4989 | /* RFC 4960 Section 9.2 | ||
4990 | * The sender of the SHUTDOWN MAY also start an overall guard timer | ||
4991 | * 'T5-shutdown-guard' to bound the overall time for shutdown sequence. | ||
4992 | */ | ||
4993 | sctp_add_cmd_sf(commands, SCTP_CMD_TIMER_START, | ||
4994 | SCTP_TO(SCTP_EVENT_TIMEOUT_T5_SHUTDOWN_GUARD)); | ||
4995 | |||
4997 | if (asoc->autoclose) | 4996 | if (asoc->autoclose) |
4998 | sctp_add_cmd_sf(commands, SCTP_CMD_TIMER_STOP, | 4997 | sctp_add_cmd_sf(commands, SCTP_CMD_TIMER_STOP, |
4999 | SCTP_TO(SCTP_EVENT_TIMEOUT_AUTOCLOSE)); | 4998 | SCTP_TO(SCTP_EVENT_TIMEOUT_AUTOCLOSE)); |
@@ -5305,6 +5304,8 @@ sctp_disposition_t sctp_sf_t1_cookie_timer_expire(const struct sctp_endpoint *ep | |||
5305 | if (!repl) | 5304 | if (!repl) |
5306 | return SCTP_DISPOSITION_NOMEM; | 5305 | return SCTP_DISPOSITION_NOMEM; |
5307 | 5306 | ||
5307 | sctp_add_cmd_sf(commands, SCTP_CMD_INIT_CHOOSE_TRANSPORT, | ||
5308 | SCTP_CHUNK(repl)); | ||
5308 | /* Issue a sideeffect to do the needed accounting. */ | 5309 | /* Issue a sideeffect to do the needed accounting. */ |
5309 | sctp_add_cmd_sf(commands, SCTP_CMD_COOKIEECHO_RESTART, | 5310 | sctp_add_cmd_sf(commands, SCTP_CMD_COOKIEECHO_RESTART, |
5310 | SCTP_TO(SCTP_EVENT_TIMEOUT_T1_COOKIE)); | 5311 | SCTP_TO(SCTP_EVENT_TIMEOUT_T1_COOKIE)); |
@@ -5432,7 +5433,7 @@ sctp_disposition_t sctp_sf_t4_timer_expire( | |||
5432 | sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED, | 5433 | sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED, |
5433 | SCTP_PERR(SCTP_ERROR_NO_ERROR)); | 5434 | SCTP_PERR(SCTP_ERROR_NO_ERROR)); |
5434 | SCTP_INC_STATS(SCTP_MIB_ABORTEDS); | 5435 | SCTP_INC_STATS(SCTP_MIB_ABORTEDS); |
5435 | SCTP_INC_STATS(SCTP_MIB_CURRESTAB); | 5436 | SCTP_DEC_STATS(SCTP_MIB_CURRESTAB); |
5436 | return SCTP_DISPOSITION_ABORT; | 5437 | return SCTP_DISPOSITION_ABORT; |
5437 | } | 5438 | } |
5438 | 5439 | ||
@@ -5488,6 +5489,9 @@ sctp_disposition_t sctp_sf_t5_timer_expire(const struct sctp_endpoint *ep, | |||
5488 | sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED, | 5489 | sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED, |
5489 | SCTP_PERR(SCTP_ERROR_NO_ERROR)); | 5490 | SCTP_PERR(SCTP_ERROR_NO_ERROR)); |
5490 | 5491 | ||
5492 | SCTP_INC_STATS(SCTP_MIB_ABORTEDS); | ||
5493 | SCTP_DEC_STATS(SCTP_MIB_CURRESTAB); | ||
5494 | |||
5491 | return SCTP_DISPOSITION_DELETE_TCB; | 5495 | return SCTP_DISPOSITION_DELETE_TCB; |
5492 | nomem: | 5496 | nomem: |
5493 | return SCTP_DISPOSITION_NOMEM; | 5497 | return SCTP_DISPOSITION_NOMEM; |
@@ -5520,12 +5524,6 @@ sctp_disposition_t sctp_sf_autoclose_timer_expire( | |||
5520 | sctp_add_cmd_sf(commands, SCTP_CMD_NEW_STATE, | 5524 | sctp_add_cmd_sf(commands, SCTP_CMD_NEW_STATE, |
5521 | SCTP_STATE(SCTP_STATE_SHUTDOWN_PENDING)); | 5525 | SCTP_STATE(SCTP_STATE_SHUTDOWN_PENDING)); |
5522 | 5526 | ||
5523 | /* sctpimpguide-05 Section 2.12.2 | ||
5524 | * The sender of the SHUTDOWN MAY also start an overall guard timer | ||
5525 | * 'T5-shutdown-guard' to bound the overall time for shutdown sequence. | ||
5526 | */ | ||
5527 | sctp_add_cmd_sf(commands, SCTP_CMD_TIMER_START, | ||
5528 | SCTP_TO(SCTP_EVENT_TIMEOUT_T5_SHUTDOWN_GUARD)); | ||
5529 | disposition = SCTP_DISPOSITION_CONSUME; | 5527 | disposition = SCTP_DISPOSITION_CONSUME; |
5530 | if (sctp_outq_is_empty(&asoc->outqueue)) { | 5528 | if (sctp_outq_is_empty(&asoc->outqueue)) { |
5531 | disposition = sctp_sf_do_9_2_start_shutdown(ep, asoc, type, | 5529 | disposition = sctp_sf_do_9_2_start_shutdown(ep, asoc, type, |