diff options
author | Wei Yongjun <yjwei@cn.fujitsu.com> | 2008-09-04 20:55:26 -0400 |
---|---|---|
committer | Vlad Yasevich <vladislav.yasevich@hp.com> | 2008-10-01 11:34:16 -0400 |
commit | 536428a9b9a98495f7ea54ad95cad83e22f1d47d (patch) | |
tree | a4a38e61207bf6144945cc5bf23cc78c8fa3bbb4 /net/sctp/sm_statefuns.c | |
parent | 52cae8f06babf9eed327479c1aa024ce3732f912 (diff) |
sctp: Fix to start T5-shutdown-guard timer while enter SHUTDOWN-SENT state
RFC 4960: Section 9.2
The sender of the SHUTDOWN MAY also start an overall guard timer
'T5-shutdown-guard' to bound the overall time for the shutdown
sequence. At the expiration of this timer, the sender SHOULD abort
the association by sending an ABORT chunk. If the 'T5-shutdown-
guard' timer is used, it SHOULD be set to the recommended value of 5
times 'RTO.Max'.
The timer 'T5-shutdown-guard' is used to counter the overall time
for shutdown sequence, and it's start by the sender of the SHUTDOWN.
So timer 'T5-shutdown-guard' should be start when we send the first
SHUTDOWN chunk and enter the SHUTDOWN-SENT state, not start when we
receipt of the SHUTDOWN primitive and enter SHUTDOWN-PENDING state.
If 'T5-shutdown-guard' timer is start at SHUTDOWN-PENDING state, the
association may be ABORT while data is still transmitting.
Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com>
Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com>
Diffstat (limited to 'net/sctp/sm_statefuns.c')
-rw-r--r-- | net/sctp/sm_statefuns.c | 24 |
1 files changed, 7 insertions, 17 deletions
diff --git a/net/sctp/sm_statefuns.c b/net/sctp/sm_statefuns.c index 7c622af2ce55..e57d1d3ad0a6 100644 --- a/net/sctp/sm_statefuns.c +++ b/net/sctp/sm_statefuns.c | |||
@@ -2076,10 +2076,6 @@ sctp_disposition_t sctp_sf_shutdown_pending_abort( | |||
2076 | sctp_bind_addr_state(&asoc->base.bind_addr, &chunk->dest)) | 2076 | sctp_bind_addr_state(&asoc->base.bind_addr, &chunk->dest)) |
2077 | return sctp_sf_discard_chunk(ep, asoc, type, arg, commands); | 2077 | return sctp_sf_discard_chunk(ep, asoc, type, arg, commands); |
2078 | 2078 | ||
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); | 2079 | return __sctp_sf_do_9_1_abort(ep, asoc, type, arg, commands); |
2084 | } | 2080 | } |
2085 | 2081 | ||
@@ -4543,13 +4539,6 @@ sctp_disposition_t sctp_sf_do_9_2_prm_shutdown( | |||
4543 | sctp_add_cmd_sf(commands, SCTP_CMD_NEW_STATE, | 4539 | sctp_add_cmd_sf(commands, SCTP_CMD_NEW_STATE, |
4544 | SCTP_STATE(SCTP_STATE_SHUTDOWN_PENDING)); | 4540 | SCTP_STATE(SCTP_STATE_SHUTDOWN_PENDING)); |
4545 | 4541 | ||
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; | 4542 | disposition = SCTP_DISPOSITION_CONSUME; |
4554 | if (sctp_outq_is_empty(&asoc->outqueue)) { | 4543 | if (sctp_outq_is_empty(&asoc->outqueue)) { |
4555 | disposition = sctp_sf_do_9_2_start_shutdown(ep, asoc, type, | 4544 | disposition = sctp_sf_do_9_2_start_shutdown(ep, asoc, type, |
@@ -4994,6 +4983,13 @@ sctp_disposition_t sctp_sf_do_9_2_start_shutdown( | |||
4994 | sctp_add_cmd_sf(commands, SCTP_CMD_TIMER_START, | 4983 | sctp_add_cmd_sf(commands, SCTP_CMD_TIMER_START, |
4995 | SCTP_TO(SCTP_EVENT_TIMEOUT_T2_SHUTDOWN)); | 4984 | SCTP_TO(SCTP_EVENT_TIMEOUT_T2_SHUTDOWN)); |
4996 | 4985 | ||
4986 | /* RFC 4960 Section 9.2 | ||
4987 | * The sender of the SHUTDOWN MAY also start an overall guard timer | ||
4988 | * 'T5-shutdown-guard' to bound the overall time for shutdown sequence. | ||
4989 | */ | ||
4990 | sctp_add_cmd_sf(commands, SCTP_CMD_TIMER_START, | ||
4991 | SCTP_TO(SCTP_EVENT_TIMEOUT_T5_SHUTDOWN_GUARD)); | ||
4992 | |||
4997 | if (asoc->autoclose) | 4993 | if (asoc->autoclose) |
4998 | sctp_add_cmd_sf(commands, SCTP_CMD_TIMER_STOP, | 4994 | sctp_add_cmd_sf(commands, SCTP_CMD_TIMER_STOP, |
4999 | SCTP_TO(SCTP_EVENT_TIMEOUT_AUTOCLOSE)); | 4995 | SCTP_TO(SCTP_EVENT_TIMEOUT_AUTOCLOSE)); |
@@ -5520,12 +5516,6 @@ sctp_disposition_t sctp_sf_autoclose_timer_expire( | |||
5520 | sctp_add_cmd_sf(commands, SCTP_CMD_NEW_STATE, | 5516 | sctp_add_cmd_sf(commands, SCTP_CMD_NEW_STATE, |
5521 | SCTP_STATE(SCTP_STATE_SHUTDOWN_PENDING)); | 5517 | SCTP_STATE(SCTP_STATE_SHUTDOWN_PENDING)); |
5522 | 5518 | ||
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; | 5519 | disposition = SCTP_DISPOSITION_CONSUME; |
5530 | if (sctp_outq_is_empty(&asoc->outqueue)) { | 5520 | if (sctp_outq_is_empty(&asoc->outqueue)) { |
5531 | disposition = sctp_sf_do_9_2_start_shutdown(ep, asoc, type, | 5521 | disposition = sctp_sf_do_9_2_start_shutdown(ep, asoc, type, |