diff options
Diffstat (limited to 'net/sctp/sm_statefuns.c')
-rw-r--r-- | net/sctp/sm_statefuns.c | 56 |
1 files changed, 36 insertions, 20 deletions
diff --git a/net/sctp/sm_statefuns.c b/net/sctp/sm_statefuns.c index b3cad8a03736..9e28a5d51200 100644 --- a/net/sctp/sm_statefuns.c +++ b/net/sctp/sm_statefuns.c | |||
@@ -186,7 +186,7 @@ sctp_disposition_t sctp_sf_do_4_C(const struct sctp_endpoint *ep, | |||
186 | * notification is passed to the upper layer. | 186 | * notification is passed to the upper layer. |
187 | */ | 187 | */ |
188 | ev = sctp_ulpevent_make_assoc_change(asoc, 0, SCTP_SHUTDOWN_COMP, | 188 | ev = sctp_ulpevent_make_assoc_change(asoc, 0, SCTP_SHUTDOWN_COMP, |
189 | 0, 0, 0, GFP_ATOMIC); | 189 | 0, 0, 0, NULL, GFP_ATOMIC); |
190 | if (ev) | 190 | if (ev) |
191 | sctp_add_cmd_sf(commands, SCTP_CMD_EVENT_ULP, | 191 | sctp_add_cmd_sf(commands, SCTP_CMD_EVENT_ULP, |
192 | SCTP_ULPEVENT(ev)); | 192 | SCTP_ULPEVENT(ev)); |
@@ -629,7 +629,7 @@ sctp_disposition_t sctp_sf_do_5_1D_ce(const struct sctp_endpoint *ep, | |||
629 | case -SCTP_IERROR_BAD_SIG: | 629 | case -SCTP_IERROR_BAD_SIG: |
630 | default: | 630 | default: |
631 | return sctp_sf_pdiscard(ep, asoc, type, arg, commands); | 631 | return sctp_sf_pdiscard(ep, asoc, type, arg, commands); |
632 | }; | 632 | } |
633 | } | 633 | } |
634 | 634 | ||
635 | 635 | ||
@@ -661,7 +661,7 @@ sctp_disposition_t sctp_sf_do_5_1D_ce(const struct sctp_endpoint *ep, | |||
661 | ev = sctp_ulpevent_make_assoc_change(new_asoc, 0, SCTP_COMM_UP, 0, | 661 | ev = sctp_ulpevent_make_assoc_change(new_asoc, 0, SCTP_COMM_UP, 0, |
662 | new_asoc->c.sinit_num_ostreams, | 662 | new_asoc->c.sinit_num_ostreams, |
663 | new_asoc->c.sinit_max_instreams, | 663 | new_asoc->c.sinit_max_instreams, |
664 | GFP_ATOMIC); | 664 | NULL, GFP_ATOMIC); |
665 | if (!ev) | 665 | if (!ev) |
666 | goto nomem_ev; | 666 | goto nomem_ev; |
667 | 667 | ||
@@ -790,7 +790,7 @@ sctp_disposition_t sctp_sf_do_5_1E_ca(const struct sctp_endpoint *ep, | |||
790 | ev = sctp_ulpevent_make_assoc_change(asoc, 0, SCTP_COMM_UP, | 790 | ev = sctp_ulpevent_make_assoc_change(asoc, 0, SCTP_COMM_UP, |
791 | 0, asoc->c.sinit_num_ostreams, | 791 | 0, asoc->c.sinit_num_ostreams, |
792 | asoc->c.sinit_max_instreams, | 792 | asoc->c.sinit_max_instreams, |
793 | GFP_ATOMIC); | 793 | NULL, GFP_ATOMIC); |
794 | 794 | ||
795 | if (!ev) | 795 | if (!ev) |
796 | goto nomem; | 796 | goto nomem; |
@@ -1195,7 +1195,7 @@ static void sctp_tietags_populate(struct sctp_association *new_asoc, | |||
1195 | new_asoc->c.my_ttag = asoc->c.my_vtag; | 1195 | new_asoc->c.my_ttag = asoc->c.my_vtag; |
1196 | new_asoc->c.peer_ttag = asoc->c.peer_vtag; | 1196 | new_asoc->c.peer_ttag = asoc->c.peer_vtag; |
1197 | break; | 1197 | break; |
1198 | }; | 1198 | } |
1199 | 1199 | ||
1200 | /* Other parameters for the endpoint SHOULD be copied from the | 1200 | /* Other parameters for the endpoint SHOULD be copied from the |
1201 | * existing parameters of the association (e.g. number of | 1201 | * existing parameters of the association (e.g. number of |
@@ -1625,7 +1625,7 @@ static sctp_disposition_t sctp_sf_do_dupcook_a(const struct sctp_endpoint *ep, | |||
1625 | ev = sctp_ulpevent_make_assoc_change(asoc, 0, SCTP_RESTART, 0, | 1625 | ev = sctp_ulpevent_make_assoc_change(asoc, 0, SCTP_RESTART, 0, |
1626 | new_asoc->c.sinit_num_ostreams, | 1626 | new_asoc->c.sinit_num_ostreams, |
1627 | new_asoc->c.sinit_max_instreams, | 1627 | new_asoc->c.sinit_max_instreams, |
1628 | GFP_ATOMIC); | 1628 | NULL, GFP_ATOMIC); |
1629 | if (!ev) | 1629 | if (!ev) |
1630 | goto nomem_ev; | 1630 | goto nomem_ev; |
1631 | 1631 | ||
@@ -1691,7 +1691,7 @@ static sctp_disposition_t sctp_sf_do_dupcook_b(const struct sctp_endpoint *ep, | |||
1691 | ev = sctp_ulpevent_make_assoc_change(asoc, 0, SCTP_COMM_UP, 0, | 1691 | ev = sctp_ulpevent_make_assoc_change(asoc, 0, SCTP_COMM_UP, 0, |
1692 | new_asoc->c.sinit_num_ostreams, | 1692 | new_asoc->c.sinit_num_ostreams, |
1693 | new_asoc->c.sinit_max_instreams, | 1693 | new_asoc->c.sinit_max_instreams, |
1694 | GFP_ATOMIC); | 1694 | NULL, GFP_ATOMIC); |
1695 | if (!ev) | 1695 | if (!ev) |
1696 | goto nomem_ev; | 1696 | goto nomem_ev; |
1697 | 1697 | ||
@@ -1786,7 +1786,7 @@ static sctp_disposition_t sctp_sf_do_dupcook_d(const struct sctp_endpoint *ep, | |||
1786 | SCTP_COMM_UP, 0, | 1786 | SCTP_COMM_UP, 0, |
1787 | asoc->c.sinit_num_ostreams, | 1787 | asoc->c.sinit_num_ostreams, |
1788 | asoc->c.sinit_max_instreams, | 1788 | asoc->c.sinit_max_instreams, |
1789 | GFP_ATOMIC); | 1789 | NULL, GFP_ATOMIC); |
1790 | if (!ev) | 1790 | if (!ev) |
1791 | goto nomem; | 1791 | goto nomem; |
1792 | 1792 | ||
@@ -1904,7 +1904,7 @@ sctp_disposition_t sctp_sf_do_5_2_4_dupcook(const struct sctp_endpoint *ep, | |||
1904 | case -SCTP_IERROR_BAD_SIG: | 1904 | case -SCTP_IERROR_BAD_SIG: |
1905 | default: | 1905 | default: |
1906 | return sctp_sf_pdiscard(ep, asoc, type, arg, commands); | 1906 | return sctp_sf_pdiscard(ep, asoc, type, arg, commands); |
1907 | }; | 1907 | } |
1908 | } | 1908 | } |
1909 | 1909 | ||
1910 | /* Compare the tie_tag in cookie with the verification tag of | 1910 | /* Compare the tie_tag in cookie with the verification tag of |
@@ -1936,7 +1936,7 @@ sctp_disposition_t sctp_sf_do_5_2_4_dupcook(const struct sctp_endpoint *ep, | |||
1936 | default: /* Discard packet for all others. */ | 1936 | default: /* Discard packet for all others. */ |
1937 | retval = sctp_sf_pdiscard(ep, asoc, type, arg, commands); | 1937 | retval = sctp_sf_pdiscard(ep, asoc, type, arg, commands); |
1938 | break; | 1938 | break; |
1939 | }; | 1939 | } |
1940 | 1940 | ||
1941 | /* Delete the tempory new association. */ | 1941 | /* Delete the tempory new association. */ |
1942 | sctp_add_cmd_sf(commands, SCTP_CMD_NEW_ASOC, SCTP_ASOC(new_asoc)); | 1942 | sctp_add_cmd_sf(commands, SCTP_CMD_NEW_ASOC, SCTP_ASOC(new_asoc)); |
@@ -3035,7 +3035,7 @@ sctp_disposition_t sctp_sf_do_9_2_final(const struct sctp_endpoint *ep, | |||
3035 | * notification is passed to the upper layer. | 3035 | * notification is passed to the upper layer. |
3036 | */ | 3036 | */ |
3037 | ev = sctp_ulpevent_make_assoc_change(asoc, 0, SCTP_SHUTDOWN_COMP, | 3037 | ev = sctp_ulpevent_make_assoc_change(asoc, 0, SCTP_SHUTDOWN_COMP, |
3038 | 0, 0, 0, GFP_ATOMIC); | 3038 | 0, 0, 0, NULL, GFP_ATOMIC); |
3039 | if (!ev) | 3039 | if (!ev) |
3040 | goto nomem; | 3040 | goto nomem; |
3041 | 3041 | ||
@@ -3115,7 +3115,7 @@ sctp_disposition_t sctp_sf_ootb(const struct sctp_endpoint *ep, | |||
3115 | break; | 3115 | break; |
3116 | 3116 | ||
3117 | ch_end = ((__u8 *)ch) + WORD_ROUND(ntohs(ch->length)); | 3117 | ch_end = ((__u8 *)ch) + WORD_ROUND(ntohs(ch->length)); |
3118 | if (ch_end > skb->tail) | 3118 | if (ch_end > skb_tail_pointer(skb)) |
3119 | break; | 3119 | break; |
3120 | 3120 | ||
3121 | if (SCTP_CID_SHUTDOWN_ACK == ch->type) | 3121 | if (SCTP_CID_SHUTDOWN_ACK == ch->type) |
@@ -3130,7 +3130,7 @@ sctp_disposition_t sctp_sf_ootb(const struct sctp_endpoint *ep, | |||
3130 | return sctp_sf_pdiscard(ep, asoc, type, arg, commands); | 3130 | return sctp_sf_pdiscard(ep, asoc, type, arg, commands); |
3131 | 3131 | ||
3132 | ch = (sctp_chunkhdr_t *) ch_end; | 3132 | ch = (sctp_chunkhdr_t *) ch_end; |
3133 | } while (ch_end < skb->tail); | 3133 | } while (ch_end < skb_tail_pointer(skb)); |
3134 | 3134 | ||
3135 | if (ootb_shut_ack) | 3135 | if (ootb_shut_ack) |
3136 | sctp_sf_shut_8_4_5(ep, asoc, type, arg, commands); | 3136 | sctp_sf_shut_8_4_5(ep, asoc, type, arg, commands); |
@@ -4342,8 +4342,24 @@ sctp_disposition_t sctp_sf_do_prm_requestheartbeat( | |||
4342 | void *arg, | 4342 | void *arg, |
4343 | sctp_cmd_seq_t *commands) | 4343 | sctp_cmd_seq_t *commands) |
4344 | { | 4344 | { |
4345 | return sctp_sf_heartbeat(ep, asoc, type, (struct sctp_transport *)arg, | 4345 | if (SCTP_DISPOSITION_NOMEM == sctp_sf_heartbeat(ep, asoc, type, |
4346 | commands); | 4346 | (struct sctp_transport *)arg, commands)) |
4347 | return SCTP_DISPOSITION_NOMEM; | ||
4348 | |||
4349 | /* | ||
4350 | * RFC 2960 (bis), section 8.3 | ||
4351 | * | ||
4352 | * D) Request an on-demand HEARTBEAT on a specific destination | ||
4353 | * transport address of a given association. | ||
4354 | * | ||
4355 | * The endpoint should increment the respective error counter of | ||
4356 | * the destination transport address each time a HEARTBEAT is sent | ||
4357 | * to that address and not acknowledged within one RTO. | ||
4358 | * | ||
4359 | */ | ||
4360 | sctp_add_cmd_sf(commands, SCTP_CMD_TRANSPORT_RESET, | ||
4361 | SCTP_TRANSPORT(arg)); | ||
4362 | return SCTP_DISPOSITION_CONSUME; | ||
4347 | } | 4363 | } |
4348 | 4364 | ||
4349 | /* | 4365 | /* |
@@ -4605,12 +4621,12 @@ sctp_disposition_t sctp_sf_do_6_3_3_rtx(const struct sctp_endpoint *ep, | |||
4605 | * sent as soon as cwnd allows (normally when a SACK arrives). | 4621 | * sent as soon as cwnd allows (normally when a SACK arrives). |
4606 | */ | 4622 | */ |
4607 | 4623 | ||
4608 | /* NB: Rules E4 and F1 are implicit in R1. */ | ||
4609 | sctp_add_cmd_sf(commands, SCTP_CMD_RETRAN, SCTP_TRANSPORT(transport)); | ||
4610 | |||
4611 | /* Do some failure management (Section 8.2). */ | 4624 | /* Do some failure management (Section 8.2). */ |
4612 | sctp_add_cmd_sf(commands, SCTP_CMD_STRIKE, SCTP_TRANSPORT(transport)); | 4625 | sctp_add_cmd_sf(commands, SCTP_CMD_STRIKE, SCTP_TRANSPORT(transport)); |
4613 | 4626 | ||
4627 | /* NB: Rules E4 and F1 are implicit in R1. */ | ||
4628 | sctp_add_cmd_sf(commands, SCTP_CMD_RETRAN, SCTP_TRANSPORT(transport)); | ||
4629 | |||
4614 | return SCTP_DISPOSITION_CONSUME; | 4630 | return SCTP_DISPOSITION_CONSUME; |
4615 | } | 4631 | } |
4616 | 4632 | ||
@@ -4800,7 +4816,7 @@ sctp_disposition_t sctp_sf_t2_timer_expire(const struct sctp_endpoint *ep, | |||
4800 | default: | 4816 | default: |
4801 | BUG(); | 4817 | BUG(); |
4802 | break; | 4818 | break; |
4803 | }; | 4819 | } |
4804 | 4820 | ||
4805 | if (!reply) | 4821 | if (!reply) |
4806 | goto nomem; | 4822 | goto nomem; |
@@ -5270,7 +5286,7 @@ static int sctp_eat_data(const struct sctp_association *asoc, | |||
5270 | chunk->ecn_ce_done = 1; | 5286 | chunk->ecn_ce_done = 1; |
5271 | 5287 | ||
5272 | af = sctp_get_af_specific( | 5288 | af = sctp_get_af_specific( |
5273 | ipver2af(chunk->skb->nh.iph->version)); | 5289 | ipver2af(ip_hdr(chunk->skb)->version)); |
5274 | 5290 | ||
5275 | if (af && af->is_ce(chunk->skb) && asoc->peer.ecn_capable) { | 5291 | if (af && af->is_ce(chunk->skb) && asoc->peer.ecn_capable) { |
5276 | /* Do real work as sideffect. */ | 5292 | /* Do real work as sideffect. */ |