sctp: Fix to handle SHUTDOWN in SHUTDOWN-PENDING state
Subsystems (2)
PATCH 1/1 sctp: Fix to handle SHUTDOWN in SHUTDOWN-PENDING state
If SHUTDOWN is received in SHUTDOWN-PENDING state, enpoint should enter the SHUTDOWN-RECEIVED state and check the Cumulative TSN Ack field of the SHUTDOWN chunk (RFC 4960 Section 9.2). If the SHUTDOWN chunk can acknowledge all of the send DATA chunks, SHUTDOWN-ACK should be sent.
But now endpoint just silently discarded the SHUTDOWN chunk.
SHUTDOWN received in SHUTDOWN-PENDING state can happend when the last SACK is lost by network, or the SHUTDOWN chunk can acknowledge all of the received DATA chunks. The packet sequence(SACK lost) is like this:
Endpoint A Endpoint B ULP
(ESTABLISHED) (ESTABLISHED)
<----------- DATA
<--- shutdown
Enter SHUTDOWN-PENDING stateSACK ----lost---->
SHUTDOWN(*1) ------------>
<----------- SHUTDOWN-ACK
(*1) silently discarded now.
This patch fix to handle SHUTDOWN in SHUTDOWN-PENDING state as the same as ESTABLISHED state.
--- net/sctp/sm_statetable.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
net/sctp/sm_statetable.c +1 -1
@@ -266,7 +266,7 @@ const sctp_sm_table_entry_t *sctp_sm_lookup_event(sctp_event_t event_type,/* SCTP_STATE_ESTABLISHED */ \TYPE_SCTP_FUNC (sctp_sf_do_9_2_shutdown), \/* SCTP_STATE_SHUTDOWN_PENDING */ \ -TYPE_SCTP_FUNC (sctp_sf_discard_chunk), \ +TYPE_SCTP_FUNC (sctp_sf_do_9_2_shutdown), \/* SCTP_STATE_SHUTDOWN_SENT */ \ TYPE_SCTP_FUNC(sctp_sf_do_9_2_shutdown_ack), \/* SCTP_STATE_SHUTDOWN_RECEIVED */ \
Signature · 1 line
1.5.3.8
PATCH 1/1 sctp: Fix to handle SHUTDOWN in SHUTDOWN_RECEIVED state
Once an endpoint has reached the SHUTDOWN-RECEIVED state, it MUST NOT send a SHUTDOWN in response to a ULP request. The Cumulative TSN Ack of the received SHUTDOWN chunk MUST be processed.
This patch fix to process Cumulative TSN Ack of the received SHUTDOWN chunk in SHUTDOWN_RECEIVED state.
--- include/net/sctp/sm.h | 1 + net/sctp/sm_statefuns.c | 45 +++++++++++++++++++++++++++++++++++++++++++++ net/sctp/sm_statetable.c | 2 +- 3 files changed, 47 insertions(+), 1 deletions(-)
include/net/sctp/sm.h +1 -0
@@ -125,6 +125,7 @@ sctp_state_fn_t sctp_sf_beat_8_3;sctp_state_fn_t sctp_sf_backbeat_8_3;sctp_state_fn_t sctp_sf_do_9_2_final;sctp_state_fn_t sctp_sf_do_9_2_shutdown; +sctp_state_fn_t sctp_sf_do_9_2_shut_ctsn;sctp_state_fn_t sctp_sf_do_ecn_cwr;sctp_state_fn_t sctp_sf_do_ecne;sctp_state_fn_t sctp_sf_ootb;
net/sctp/sm_statefuns.c +45 -0
51 lines not on this page · raw message
net/sctp/sm_statetable.c +1 -1
@@ -270,7 +270,7 @@ const sctp_sm_table_entry_t *sctp_sm_lookup_event(sctp_event_t event_type,/* SCTP_STATE_SHUTDOWN_SENT */ \TYPE_SCTP_FUNC (sctp_sf_do_9_2_shutdown_ack), \/* SCTP_STATE_SHUTDOWN_RECEIVED */ \ -TYPE_SCTP_FUNC (sctp_sf_discard_chunk), \ +TYPE_SCTP_FUNC (sctp_sf_do_9_2_shut_ctsn), \/* SCTP_STATE_SHUTDOWN_ACK_SENT */ \ TYPE_SCTP_FUNC(sctp_sf_discard_chunk), \ } /* TYPE_SCTP_SHUTDOWN */
Signature · 1 line
1.6.0.2.530.g67faa