diff options
Diffstat (limited to 'net/sctp/sm_statefuns.c')
-rw-r--r-- | net/sctp/sm_statefuns.c | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/net/sctp/sm_statefuns.c b/net/sctp/sm_statefuns.c index d4df45022ffa..1ef9de9bbae9 100644 --- a/net/sctp/sm_statefuns.c +++ b/net/sctp/sm_statefuns.c | |||
@@ -996,14 +996,15 @@ sctp_disposition_t sctp_sf_sendbeat_8_3(const struct sctp_endpoint *ep, | |||
996 | sctp_sf_heartbeat(ep, asoc, type, arg, | 996 | sctp_sf_heartbeat(ep, asoc, type, arg, |
997 | commands)) | 997 | commands)) |
998 | return SCTP_DISPOSITION_NOMEM; | 998 | return SCTP_DISPOSITION_NOMEM; |
999 | |||
999 | /* Set transport error counter and association error counter | 1000 | /* Set transport error counter and association error counter |
1000 | * when sending heartbeat. | 1001 | * when sending heartbeat. |
1001 | */ | 1002 | */ |
1002 | sctp_add_cmd_sf(commands, SCTP_CMD_TRANSPORT_IDLE, | ||
1003 | SCTP_TRANSPORT(transport)); | ||
1004 | sctp_add_cmd_sf(commands, SCTP_CMD_TRANSPORT_HB_SENT, | 1003 | sctp_add_cmd_sf(commands, SCTP_CMD_TRANSPORT_HB_SENT, |
1005 | SCTP_TRANSPORT(transport)); | 1004 | SCTP_TRANSPORT(transport)); |
1006 | } | 1005 | } |
1006 | sctp_add_cmd_sf(commands, SCTP_CMD_TRANSPORT_IDLE, | ||
1007 | SCTP_TRANSPORT(transport)); | ||
1007 | sctp_add_cmd_sf(commands, SCTP_CMD_HB_TIMER_UPDATE, | 1008 | sctp_add_cmd_sf(commands, SCTP_CMD_HB_TIMER_UPDATE, |
1008 | SCTP_TRANSPORT(transport)); | 1009 | SCTP_TRANSPORT(transport)); |
1009 | 1010 | ||
@@ -1720,7 +1721,7 @@ static sctp_disposition_t sctp_sf_do_dupcook_a(const struct sctp_endpoint *ep, | |||
1720 | 1721 | ||
1721 | err = sctp_make_op_error(asoc, chunk, | 1722 | err = sctp_make_op_error(asoc, chunk, |
1722 | SCTP_ERROR_COOKIE_IN_SHUTDOWN, | 1723 | SCTP_ERROR_COOKIE_IN_SHUTDOWN, |
1723 | NULL, 0); | 1724 | NULL, 0, 0); |
1724 | if (err) | 1725 | if (err) |
1725 | sctp_add_cmd_sf(commands, SCTP_CMD_REPLY, | 1726 | sctp_add_cmd_sf(commands, SCTP_CMD_REPLY, |
1726 | SCTP_CHUNK(err)); | 1727 | SCTP_CHUNK(err)); |
@@ -2868,6 +2869,7 @@ sctp_disposition_t sctp_sf_eat_data_6_2(const struct sctp_endpoint *ep, | |||
2868 | sctp_cmd_seq_t *commands) | 2869 | sctp_cmd_seq_t *commands) |
2869 | { | 2870 | { |
2870 | struct sctp_chunk *chunk = arg; | 2871 | struct sctp_chunk *chunk = arg; |
2872 | sctp_arg_t force = SCTP_NOFORCE(); | ||
2871 | int error; | 2873 | int error; |
2872 | 2874 | ||
2873 | if (!sctp_vtag_verify(chunk, asoc)) { | 2875 | if (!sctp_vtag_verify(chunk, asoc)) { |
@@ -2901,6 +2903,9 @@ sctp_disposition_t sctp_sf_eat_data_6_2(const struct sctp_endpoint *ep, | |||
2901 | BUG(); | 2903 | BUG(); |
2902 | } | 2904 | } |
2903 | 2905 | ||
2906 | if (chunk->chunk_hdr->flags & SCTP_DATA_SACK_IMM) | ||
2907 | force = SCTP_FORCE(); | ||
2908 | |||
2904 | if (asoc->autoclose) { | 2909 | if (asoc->autoclose) { |
2905 | sctp_add_cmd_sf(commands, SCTP_CMD_TIMER_RESTART, | 2910 | sctp_add_cmd_sf(commands, SCTP_CMD_TIMER_RESTART, |
2906 | SCTP_TO(SCTP_EVENT_TIMEOUT_AUTOCLOSE)); | 2911 | SCTP_TO(SCTP_EVENT_TIMEOUT_AUTOCLOSE)); |
@@ -2929,7 +2934,7 @@ sctp_disposition_t sctp_sf_eat_data_6_2(const struct sctp_endpoint *ep, | |||
2929 | * more aggressive than the following algorithms allow. | 2934 | * more aggressive than the following algorithms allow. |
2930 | */ | 2935 | */ |
2931 | if (chunk->end_of_packet) | 2936 | if (chunk->end_of_packet) |
2932 | sctp_add_cmd_sf(commands, SCTP_CMD_GEN_SACK, SCTP_NOFORCE()); | 2937 | sctp_add_cmd_sf(commands, SCTP_CMD_GEN_SACK, force); |
2933 | 2938 | ||
2934 | return SCTP_DISPOSITION_CONSUME; | 2939 | return SCTP_DISPOSITION_CONSUME; |
2935 | 2940 | ||
@@ -2954,7 +2959,7 @@ discard_force: | |||
2954 | 2959 | ||
2955 | discard_noforce: | 2960 | discard_noforce: |
2956 | if (chunk->end_of_packet) | 2961 | if (chunk->end_of_packet) |
2957 | sctp_add_cmd_sf(commands, SCTP_CMD_GEN_SACK, SCTP_NOFORCE()); | 2962 | sctp_add_cmd_sf(commands, SCTP_CMD_GEN_SACK, force); |
2958 | 2963 | ||
2959 | return SCTP_DISPOSITION_DISCARD; | 2964 | return SCTP_DISPOSITION_DISCARD; |
2960 | consume: | 2965 | consume: |
@@ -3973,7 +3978,7 @@ sctp_disposition_t sctp_sf_eat_auth(const struct sctp_endpoint *ep, | |||
3973 | err_chunk = sctp_make_op_error(asoc, chunk, | 3978 | err_chunk = sctp_make_op_error(asoc, chunk, |
3974 | SCTP_ERROR_UNSUP_HMAC, | 3979 | SCTP_ERROR_UNSUP_HMAC, |
3975 | &auth_hdr->hmac_id, | 3980 | &auth_hdr->hmac_id, |
3976 | sizeof(__u16)); | 3981 | sizeof(__u16), 0); |
3977 | if (err_chunk) { | 3982 | if (err_chunk) { |
3978 | sctp_add_cmd_sf(commands, SCTP_CMD_REPLY, | 3983 | sctp_add_cmd_sf(commands, SCTP_CMD_REPLY, |
3979 | SCTP_CHUNK(err_chunk)); | 3984 | SCTP_CHUNK(err_chunk)); |
@@ -4065,7 +4070,8 @@ sctp_disposition_t sctp_sf_unk_chunk(const struct sctp_endpoint *ep, | |||
4065 | hdr = unk_chunk->chunk_hdr; | 4070 | hdr = unk_chunk->chunk_hdr; |
4066 | err_chunk = sctp_make_op_error(asoc, unk_chunk, | 4071 | err_chunk = sctp_make_op_error(asoc, unk_chunk, |
4067 | SCTP_ERROR_UNKNOWN_CHUNK, hdr, | 4072 | SCTP_ERROR_UNKNOWN_CHUNK, hdr, |
4068 | WORD_ROUND(ntohs(hdr->length))); | 4073 | WORD_ROUND(ntohs(hdr->length)), |
4074 | 0); | ||
4069 | if (err_chunk) { | 4075 | if (err_chunk) { |
4070 | sctp_add_cmd_sf(commands, SCTP_CMD_REPLY, | 4076 | sctp_add_cmd_sf(commands, SCTP_CMD_REPLY, |
4071 | SCTP_CHUNK(err_chunk)); | 4077 | SCTP_CHUNK(err_chunk)); |
@@ -4084,7 +4090,8 @@ sctp_disposition_t sctp_sf_unk_chunk(const struct sctp_endpoint *ep, | |||
4084 | hdr = unk_chunk->chunk_hdr; | 4090 | hdr = unk_chunk->chunk_hdr; |
4085 | err_chunk = sctp_make_op_error(asoc, unk_chunk, | 4091 | err_chunk = sctp_make_op_error(asoc, unk_chunk, |
4086 | SCTP_ERROR_UNKNOWN_CHUNK, hdr, | 4092 | SCTP_ERROR_UNKNOWN_CHUNK, hdr, |
4087 | WORD_ROUND(ntohs(hdr->length))); | 4093 | WORD_ROUND(ntohs(hdr->length)), |
4094 | 0); | ||
4088 | if (err_chunk) { | 4095 | if (err_chunk) { |
4089 | sctp_add_cmd_sf(commands, SCTP_CMD_REPLY, | 4096 | sctp_add_cmd_sf(commands, SCTP_CMD_REPLY, |
4090 | SCTP_CHUNK(err_chunk)); | 4097 | SCTP_CHUNK(err_chunk)); |
@@ -6048,7 +6055,8 @@ static int sctp_eat_data(const struct sctp_association *asoc, | |||
6048 | 6055 | ||
6049 | err = sctp_make_op_error(asoc, chunk, SCTP_ERROR_INV_STRM, | 6056 | err = sctp_make_op_error(asoc, chunk, SCTP_ERROR_INV_STRM, |
6050 | &data_hdr->stream, | 6057 | &data_hdr->stream, |
6051 | sizeof(data_hdr->stream)); | 6058 | sizeof(data_hdr->stream), |
6059 | sizeof(u16)); | ||
6052 | if (err) | 6060 | if (err) |
6053 | sctp_add_cmd_sf(commands, SCTP_CMD_REPLY, | 6061 | sctp_add_cmd_sf(commands, SCTP_CMD_REPLY, |
6054 | SCTP_CHUNK(err)); | 6062 | SCTP_CHUNK(err)); |