diff options
Diffstat (limited to 'net/sctp/sm_statefuns.c')
-rw-r--r-- | net/sctp/sm_statefuns.c | 57 |
1 files changed, 32 insertions, 25 deletions
diff --git a/net/sctp/sm_statefuns.c b/net/sctp/sm_statefuns.c index 246117142b5..a0f31e6c1c6 100644 --- a/net/sctp/sm_statefuns.c +++ b/net/sctp/sm_statefuns.c | |||
@@ -2047,6 +2047,12 @@ sctp_disposition_t sctp_sf_do_5_2_4_dupcook(const struct sctp_endpoint *ep, | |||
2047 | sctp_add_cmd_sf(commands, SCTP_CMD_NEW_ASOC, SCTP_ASOC(new_asoc)); | 2047 | sctp_add_cmd_sf(commands, SCTP_CMD_NEW_ASOC, SCTP_ASOC(new_asoc)); |
2048 | sctp_add_cmd_sf(commands, SCTP_CMD_DELETE_TCB, SCTP_NULL()); | 2048 | sctp_add_cmd_sf(commands, SCTP_CMD_DELETE_TCB, SCTP_NULL()); |
2049 | 2049 | ||
2050 | /* Restore association pointer to provide SCTP command interpeter | ||
2051 | * with a valid context in case it needs to manipulate | ||
2052 | * the queues */ | ||
2053 | sctp_add_cmd_sf(commands, SCTP_CMD_SET_ASOC, | ||
2054 | SCTP_ASOC((struct sctp_association *)asoc)); | ||
2055 | |||
2050 | return retval; | 2056 | return retval; |
2051 | 2057 | ||
2052 | nomem: | 2058 | nomem: |
@@ -4008,31 +4014,32 @@ sctp_disposition_t sctp_sf_eat_auth(const struct sctp_endpoint *ep, | |||
4008 | auth_hdr = (struct sctp_authhdr *)chunk->skb->data; | 4014 | auth_hdr = (struct sctp_authhdr *)chunk->skb->data; |
4009 | error = sctp_sf_authenticate(ep, asoc, type, chunk); | 4015 | error = sctp_sf_authenticate(ep, asoc, type, chunk); |
4010 | switch (error) { | 4016 | switch (error) { |
4011 | case SCTP_IERROR_AUTH_BAD_HMAC: | 4017 | case SCTP_IERROR_AUTH_BAD_HMAC: |
4012 | /* Generate the ERROR chunk and discard the rest | 4018 | /* Generate the ERROR chunk and discard the rest |
4013 | * of the packet | 4019 | * of the packet |
4014 | */ | 4020 | */ |
4015 | err_chunk = sctp_make_op_error(asoc, chunk, | 4021 | err_chunk = sctp_make_op_error(asoc, chunk, |
4016 | SCTP_ERROR_UNSUP_HMAC, | 4022 | SCTP_ERROR_UNSUP_HMAC, |
4017 | &auth_hdr->hmac_id, | 4023 | &auth_hdr->hmac_id, |
4018 | sizeof(__u16), 0); | 4024 | sizeof(__u16), 0); |
4019 | if (err_chunk) { | 4025 | if (err_chunk) { |
4020 | sctp_add_cmd_sf(commands, SCTP_CMD_REPLY, | 4026 | sctp_add_cmd_sf(commands, SCTP_CMD_REPLY, |
4021 | SCTP_CHUNK(err_chunk)); | 4027 | SCTP_CHUNK(err_chunk)); |
4022 | } | 4028 | } |
4023 | /* Fall Through */ | 4029 | /* Fall Through */ |
4024 | case SCTP_IERROR_AUTH_BAD_KEYID: | 4030 | case SCTP_IERROR_AUTH_BAD_KEYID: |
4025 | case SCTP_IERROR_BAD_SIG: | 4031 | case SCTP_IERROR_BAD_SIG: |
4026 | return sctp_sf_pdiscard(ep, asoc, type, arg, commands); | 4032 | return sctp_sf_pdiscard(ep, asoc, type, arg, commands); |
4027 | break; | 4033 | |
4028 | case SCTP_IERROR_PROTO_VIOLATION: | 4034 | case SCTP_IERROR_PROTO_VIOLATION: |
4029 | return sctp_sf_violation_chunklen(ep, asoc, type, arg, | 4035 | return sctp_sf_violation_chunklen(ep, asoc, type, arg, |
4030 | commands); | 4036 | commands); |
4031 | break; | 4037 | |
4032 | case SCTP_IERROR_NOMEM: | 4038 | case SCTP_IERROR_NOMEM: |
4033 | return SCTP_DISPOSITION_NOMEM; | 4039 | return SCTP_DISPOSITION_NOMEM; |
4034 | default: | 4040 | |
4035 | break; | 4041 | default: /* Prevent gcc warnings */ |
4042 | break; | ||
4036 | } | 4043 | } |
4037 | 4044 | ||
4038 | if (asoc->active_key_id != ntohs(auth_hdr->shkey_id)) { | 4045 | if (asoc->active_key_id != ntohs(auth_hdr->shkey_id)) { |