aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVlad Yasevich <vladislav.yasevich@hp.com>2007-01-15 22:18:30 -0500
committerDavid S. Miller <davem@sunset.davemloft.net>2007-01-23 23:25:46 -0500
commit610ab73ac4cc8912fc253bbdc6d1f74bad3c8e3a (patch)
tree311593c67bcc70b1cc298543a74c6ae25632ef1a
parentd023f629451ace6f37eb5d2cf29ddd24497c91dc (diff)
[SCTP]: Correctly handle unexpected INIT-ACK chunk.
Consider the chunk as Out-of-the-Blue if we don't have an endpoint. Otherwise discard it as before. Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com> Signed-off-by: Sridhar Samudrala <sri@us.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--include/net/sctp/sm.h1
-rw-r--r--net/sctp/sm_statefuns.c22
-rw-r--r--net/sctp/sm_statetable.c2
3 files changed, 24 insertions, 1 deletions
diff --git a/include/net/sctp/sm.h b/include/net/sctp/sm.h
index 3269ed1cc222..73cb9943c8a8 100644
--- a/include/net/sctp/sm.h
+++ b/include/net/sctp/sm.h
@@ -134,6 +134,7 @@ sctp_state_fn_t sctp_sf_violation;
134sctp_state_fn_t sctp_sf_discard_chunk; 134sctp_state_fn_t sctp_sf_discard_chunk;
135sctp_state_fn_t sctp_sf_do_5_2_1_siminit; 135sctp_state_fn_t sctp_sf_do_5_2_1_siminit;
136sctp_state_fn_t sctp_sf_do_5_2_2_dupinit; 136sctp_state_fn_t sctp_sf_do_5_2_2_dupinit;
137sctp_state_fn_t sctp_sf_do_5_2_3_initack;
137sctp_state_fn_t sctp_sf_do_5_2_4_dupcook; 138sctp_state_fn_t sctp_sf_do_5_2_4_dupcook;
138sctp_state_fn_t sctp_sf_unk_chunk; 139sctp_state_fn_t sctp_sf_unk_chunk;
139sctp_state_fn_t sctp_sf_do_8_5_1_E_sa; 140sctp_state_fn_t sctp_sf_do_8_5_1_E_sa;
diff --git a/net/sctp/sm_statefuns.c b/net/sctp/sm_statefuns.c
index 2c165dc9fb71..fce1f602cde2 100644
--- a/net/sctp/sm_statefuns.c
+++ b/net/sctp/sm_statefuns.c
@@ -1534,6 +1534,28 @@ sctp_disposition_t sctp_sf_do_5_2_2_dupinit(const struct sctp_endpoint *ep,
1534} 1534}
1535 1535
1536 1536
1537/*
1538 * Unexpected INIT-ACK handler.
1539 *
1540 * Section 5.2.3
1541 * If an INIT ACK received by an endpoint in any state other than the
1542 * COOKIE-WAIT state, the endpoint should discard the INIT ACK chunk.
1543 * An unexpected INIT ACK usually indicates the processing of an old or
1544 * duplicated INIT chunk.
1545*/
1546sctp_disposition_t sctp_sf_do_5_2_3_initack(const struct sctp_endpoint *ep,
1547 const struct sctp_association *asoc,
1548 const sctp_subtype_t type,
1549 void *arg, sctp_cmd_seq_t *commands)
1550{
1551 /* Per the above section, we'll discard the chunk if we have an
1552 * endpoint. If this is an OOTB INIT-ACK, treat it as such.
1553 */
1554 if (ep == sctp_sk((sctp_get_ctl_sock()))->ep)
1555 return sctp_sf_ootb(ep, asoc, type, arg, commands);
1556 else
1557 return sctp_sf_discard_chunk(ep, asoc, type, arg, commands);
1558}
1537 1559
1538/* Unexpected COOKIE-ECHO handler for peer restart (Table 2, action 'A') 1560/* Unexpected COOKIE-ECHO handler for peer restart (Table 2, action 'A')
1539 * 1561 *
diff --git a/net/sctp/sm_statetable.c b/net/sctp/sm_statetable.c
index 733dd87b3a7d..5f6cc7aa661b 100644
--- a/net/sctp/sm_statetable.c
+++ b/net/sctp/sm_statetable.c
@@ -152,7 +152,7 @@ const sctp_sm_table_entry_t *sctp_sm_lookup_event(sctp_event_t event_type,
152 /* SCTP_STATE_EMPTY */ \ 152 /* SCTP_STATE_EMPTY */ \
153 TYPE_SCTP_FUNC(sctp_sf_ootb), \ 153 TYPE_SCTP_FUNC(sctp_sf_ootb), \
154 /* SCTP_STATE_CLOSED */ \ 154 /* SCTP_STATE_CLOSED */ \
155 TYPE_SCTP_FUNC(sctp_sf_discard_chunk), \ 155 TYPE_SCTP_FUNC(sctp_sf_do_5_2_3_initack), \
156 /* SCTP_STATE_COOKIE_WAIT */ \ 156 /* SCTP_STATE_COOKIE_WAIT */ \
157 TYPE_SCTP_FUNC(sctp_sf_do_5_1C_ack), \ 157 TYPE_SCTP_FUNC(sctp_sf_do_5_1C_ack), \
158 /* SCTP_STATE_COOKIE_ECHOED */ \ 158 /* SCTP_STATE_COOKIE_ECHOED */ \